Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minWidth: true doesn't not minimize width to icon size #91

Open
Mariusthvdb opened this issue Feb 21, 2023 · 5 comments
Open

minWidth: true doesn't not minimize width to icon size #91

Mariusthvdb opened this issue Feb 21, 2023 · 5 comments

Comments

@Mariusthvdb
Copy link

Mariusthvdb commented Feb 21, 2023

not sure if (where) we've discussed this before, so please allow me a dedicated issue on the matter.

using a main

type: custom:tabbed-card
attributes:
  minWidth: true
  isMinWidthIndicator: true

config one a set of tabbed cards only using an icon in the tab, still makes the card tabs go beyond the width of a single card, and added to that, we can not swipe it really. the overflow icon somewhat comes in sight when the one next to it is activated, but there's no real swiping the tabs

Maybe I am misconfiguring, if so please correct, but I would have hoped that 4 or 5 icons only should be able to be seen directly and not have it look like:

Scherm­afbeelding 2023-02-21 om 13 28 47

Scherm­afbeelding 2023-02-21 om 13 29 17

seems the minWidth indicator is working correctly, because this is without. As you can see, the tabs are just as wide in both configurations.
Scherm­afbeelding 2023-02-21 om 13 28 23

of course, I have also tried to set that option on the card itself:

    attributes:
      icon: mdi:home-roof
      minWidth: true

to no avail though, no difference at all
Please have a look why those tabs are not tighter, just as tight as the indicator

@gryzli133
Copy link

Same issue here, I would like to have 6-7 tabs with just an icon. Normally they could be all visible without scrolling, when they have no margins on both sides of the icon. Setting "minWidth: true" also did not changed that:

image

@Mariusthvdb
Copy link
Author

you can do that using this:

type: custom:mod-card
card_mod:
  style:
    tabbed-card $:
      mwc-tab:
        $:
          mwc-tab-indicator $: |
           .mdc-tab-indicator__content--underline {
              border-color: var(--text-color-off) !important;
            }

          .: |
            .mdc-tab {
              min-width: 40px !important;;
              background: var(--primary-color) !important;
            }
            .material-icons {
              display: contents !important;
            }
            .mdc-tab--active {
              --mdc-icon-size: {{states('input_number.active_icon_size')}}px;
              /*background: var(--text-color-off) !important;*/
            }

#     .: |
#       tabbed-card {
#         --mdc-tab-horizontal-padding: 0px;
#       }

card:
  type: custom:tabbed-card
#   attributes:
  #   isFadingIndicator: true
  styles:
    --mdc-tab-horizontal-padding: 0px;
    --mdc-theme-primary: gold
    --mdc-tab-color-default: var(--text-primary-color)
  tabs:

note the horizontal-padding is a card config option, and you need to adjust your own preference for the min-width. Ive set the to 40, but you can play with that

@gryzli133
Copy link

thank you, in case there will be no update soon (solving that issue) then I will use your workaround ;-)

image

@crafty35a
Copy link

Maybe it's obvious, but this issue also applies to tabs using short text strings, not just icons:

image

There are 24h and 36h tabs hidden here that could easily fit without scrolling. It would be great for this to be fixed without needing card-mod!

@mogim0gi
Copy link

can you please PLEASE implement this, the card-mod cannot be solution to every enhancement suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants