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

swiper-pagination-color not applied to 'fraction' #66

Open
Mariusthvdb opened this issue Jan 23, 2023 · 2 comments
Open

swiper-pagination-color not applied to 'fraction' #66

Mariusthvdb opened this issue Jan 23, 2023 · 2 comments

Comments

@Mariusthvdb
Copy link

when using either bullets or progress bar on pagination, the theme color swiper-pagination-color is applied.
in theme:

    swiper-pagination-color: red #apllied to bullets (but only the active) And progressbar but Not to fraction
    swiper-navigation-color: red #applied to left/right arrows
    swiper-navigation-size: 30px #applied to left/right arrows

However, when using fraction, to show 1/3, that same theme color is not applied.
We can see in dev tools inspector that

Scherm­afbeelding 2023-01-23 om 12 08 04

however, trying t set that using card_mod has no effect (probably;y because I havent found the correct syntax yet)

            card_mod:
              style: |
                :host {
                  color: red;
                }

I did try and search in the resource where this might be set, to see if we can fix it (seems a bug/omission), but no luck there.

Leaving 2 issues:

  • how to set the color on the fraction pagination
  • how to set the background color on the inactive pagination bullet swiper-pagination-bullet:

Scherm­afbeelding 2023-01-22 om 23 10 16

@Mariusthvdb
Copy link
Author

Mariusthvdb commented Jan 23, 2023

this seems to work for the fraction:
use mod-card

        - type: custom:mod-card
          card_mod:
            style:
              swipe-card:
                $: |
                  /* colors the whole fraction  element: '1/3' */
                  /*.swiper-pagination-fraction {
                    color: white;
                  }*/
                  /* colors the '1' in: '1/3' */
                  .swiper-pagination-current {
                    color: var(--swiper-navigation-color);
                  }
                  /* colors the '3' in: '1/3' */
                  .swiper-pagination-total {
                    color: gold;
                  }
              .: |
                ha-card {
                  font-weight: bold;
                  font-size: 20px;
                  color: white; */sets the full line, or only the '/', when the other elements are colored individually
                }

though using custom:mod-card on the swipe-card causes intermittent cards to be not displayed inside the swiper..

making this useless.

Ill write that in a dedicated issue, so it is visible for others, and not buried inside this

@mamarguerat
Copy link

Same problem here. I wanted to change the inactive pagination bullet color with swiper-pagination-bullet. With card-mod it works but it's very slow or doesn't charge the card. I tried with custom CSS as ressource but it doesn't work neither.
The main problem with this color is that the default is to #000 and opacity at 0.2 and for dark mode we can't see the bullets.
image

Is there a possibility to update the card with a CSS variable for the color, for example var(--secondary-text-color) or var( --ha-card-background) ?

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

2 participants