kinghat / tabbed-card

a custom card for home assistant that utilizes tabs to segregate individual cards.
MIT License
87 stars 10 forks source link

Icon not vertically centered #82

Closed ildar170975 closed 1 year ago

ildar170975 commented 1 year ago

Compare these variants:

изображение

The 2nd variant is a default view, the 1st variant is styled by card-mod:

type: vertical-stack
cards:
  - type: custom:mod-card
    card_mod:
      style:
        tabbed-card $:
          mwc-tab: |
            ha-icon {
              display: inline-flex;
            }
    card:
      type: custom:tabbed-card
      attributes:
        icon: mdi:circle
      tabs: &ref_tabs
        - card:
            type: entities
            entities:
              - sun.sun
          attributes:
            label: label 1
        - card:
            type: entity
            entity: sun.sun
          attributes:
            label: label 2
  - type: custom:tabbed-card
    attributes:
      icon: mdi:circle
    tabs: *ref_tabs

I suggest to use the display: inline-flex style as a default.

kinghat commented 1 year ago

already an issue for that: https://github.com/kinghat/tabbed-card/issues/77 and has been fixed: https://github.com/kinghat/tabbed-card/commit/4a99ce037a5f29f3bdd4f8152ac7ed4a2966a7e3 which will be apart of the 0.4.0 release.

ildar170975 commented 1 year ago

Actually, I am not sure we should add a margin... it only adds a shift - while alignment may be done by a proper style.

Update: sorry, you fixed it by --ha-icon-display: inline; - GOOD