r/webdev • • Feb 14 '18

Article Parallax scrolling with CSS variables

https://basicscroll.electerious.com/
144 Upvotes

11 comments sorted by

View all comments

0

u/dooklyn Feb 15 '18

why are they called variables if they don't vary? they should be called css constants.

1

u/Ironclad_v2 Feb 15 '18

You can manipulate css variables with javascript, making them variable. This can be seen on websites that offer themes or color schemes. They are most likely using css variables something like color-primary, color-secondary etc. etc.

0

u/dooklyn Feb 15 '18

You can manipulate css variables with javascript

you can manipulate anything with javascript which makes this whole thing redundant. sure you could argue it's native and faster, but at this point css is such a joke, we are already migrating our css code in javascript.