-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use Sass 3 (SCSS; Sassy CSS) as a pre-processor for styling #1049
Conversation
Looks nice. 20% shorter! Seems like there should be a way to verify that the new form is equivalent, but I didn't find it in a quick search. I think it's better to leave anything that is not data-driven in the hands of CSS so that it's easily customizable without writing "real" code. This kind of thing happens otherwise. |
Okay, I found Alan Hart's Compare CSS Tool and after manually normalizing a bunch of stuff (it doesn't seem to handle |
On closer examination, it's 50/50
|
FWIW a couple of selectors were also more specific, like |
Thanks @mtraynham! I think there is some stuff that could still be simplified, but this helps organize the styles a lot! Merged for 2.0.0-beta.33 |
👍 Thanks @gordonwoodhull ! |
Styling is a pain, at least when keeping things consistent. Less & Sass are great for these kinds of things since they map well to the HTML DOM hierarchy rather than the flat list of CSS selectors, also providing variables/mixins.
Sass has a larger community, so that's my reasoning for choosing one over the other.
Ideally, it may even be better to just use d3.js to select these nodes and use SVG attributes instead of styling. CSS (& Sass or Less) is a fairly mute tool here.