Closed th-km closed 2 years ago
Hi @th-km,
I think you need to make sure the JSON string is on a single line for the CSS parser to parse it correctly. Try this:
.embla__viewport:before {
display: none;
content: '{ "draggable": false, "loop": true }'; /* <--- put it on a single line */
}
Best, David
Hey @davidjerleke, thanks for the quick reply. Indeed it worked perfectly!
It might be worth it to specify this on the documentation, I tried all kinds of hacks, but haven't thought about doing it inline.
@th-km I agree. Feel free to submit a pull request if you want to contribute.
Best, David
Bug is related to
embla-carousel-react
Embla Carousel version
v6.2.0
Describe the bug
Changing Embla options through CSS doesn't seem to work. Both VSCode and CodeSandbox flag the CSS as "non-valid", and the pseudo options part breaks the CSS layout.
CodeSandbox
https://codesandbox.io/s/embla-carousel-default-react-forked-4qptzn?file=/src/css/embla.css
Steps to reproduce
Expected behavior
Embla should be able to pick options defined in your CSS file as mentioned here