Swiper: Import Modular SCSS and $themeColor variable

Created on 6 Nov 2019  路  5Comments  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [x] bug
  • [ ] enhancement
  • [ ] feature-discussion (RFC)

What you did

Importing all SCSS node_modules/swiper/components components to load only what i want. See _swiper.scss : https://codesandbox.io/embed/great-heisenberg-f7uyy

Also, i wrote (& commented) a dirty fix, i would avoid using it :D

Expected Behavior

Navigation arrows should get the $themeColor color.

Actual Behavior

Navigation arrows stays black.

Thanks 馃檶

All 5 comments

This seems more of a styling issue with your code, rather than a swiper problem?

Ive fixed your code here @proov

it seems you werent targetting the arrows for any styles

add this to your swiper.scss file

.swiper-button-prev,
.swiper-button-next {
  &:after {
    color: $themeColor;
  }
}

@proov I'm with you. I feel like the line in components/core/core.scss should be interpolated:

--swiper-theme-color: #{$themeColor};

If I make that change in my src (or use your "dirty" fix) then it works exactly as expected.

@proov I'm with you. I feel like the line in components/core/core.scss should be interpolated:

--swiper-theme-color: #{$themeColor};

If I make that change in my src (or use your "dirty" fix) then it works exactly as expected.

Yeah that's what i think too 馃槄

Fixed by #3334

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joakimk picture joakimk  路  3Comments

voodoo6 picture voodoo6  路  3Comments

QJan84 picture QJan84  路  3Comments

callumacrae picture callumacrae  路  3Comments

TomDeSmet picture TomDeSmet  路  3Comments