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
Optional colons in Sass? #228
Comments
dear god. no. |
? Any rationale or just a question of taste? For the record, I constantly On Tue, Jan 10, 2012 at 4:37 PM, Chris Eppstein <
|
I think it makes things very hard to read without syntax highlighting. |
I agree with Chris here. The lack of colons make it very difficult to tell properties apart from selectors at a glance. |
Sorry to bump an old topic, but seriously? Do you guys not use a text editor with syntax coloring? I know people who roll their eyes when they find out I use sass and not scss. But the colon is a completely reduntant bit of cruft, why not let people who don't want it drop it? |
Not everyone uses syntax highlighting, not everyone's editor has Sass highlighting available, and not every Sass highlighting package is configured in such a way as to make this pattern in particular readable. It's our job to design syntax that's broadly useful, not syntax that uses a minimal number of characters. |
There's a very solid workaround to the "very hard to read" argument. Can it be an optional thing? The nice (truly, truly wonderful) thing about Stylus is that it doesn't enforce either. You can be as slim or as verbose as you want. It doesn't have an opinion. You can use colons if you want or not; entirely up to taste/need. That is a happy medium. If you work in an editor that hates syntax highlighting, use colons. If you're using something that highlights, no need. @nex3 I understand your comment about editors, so this scenario (optional colons) addresses both needs. Why would anyone not want colons? I've worked in both SASS and Stylus extensively, and hands down, the non-colon option is the winner in my book. It's easier to type, just as easy to read (in the right editor, see embeds). But there's an actual additional reason. When using Jade or Slim hand in hand, it becomes even easier to copy back and forth from a Side note, for those who do use contextual highlighting editors, they do scan the same: It would be nice for this issue to get some more serious consideration, not just based on preference. I've tried to present the pros in a way that works for everyone. Update/Aside: I updated my comment to be more pleasant. This is something I would actually love to see implemented, and would absolutely be valuable, so I'm trying to make the case instead of just expressing sentiment. |
I'll chip in for optional colons. I've used Stylus for the last few years and need to move over to Sass now, and I agree with all of the points @arxpoetica makes. A further argument, though at first it seems trivial, it that this would save at least hundreds of key presses per day for people who write CSS all day like myself. I hope to be working for the next 35 years and have basically resigned myself to having arthritis as I get older, (as we all likely will) but even removing a few hundred key presses per day could help reduce that slightly over time. Anyway, I prefer setting the text editor to colourise text and do the work for me, so it would be great if removing colons was an option. |
I'd opt for optional colons not only in Sass, but SCSS files as well. Honestly, I don't see how lack of colons introduce any readability issues. They are needed only for single-lined selectors with multiple properties, otherwise newline can serve as quite strong indicator of statement end. I wonder, how do we live with ES6 where semicolons finally optional and never had that issue with readability. JavaScript without colons is a bliss. I passionately hated colons from the day 1 when I started to learn JavaScript, and hate them in CSS. If not linters, I would continue to constantly forget to place them and break my code. I'm sure I'm not the only one. |
Whether a developer finds it harder to read css with colons / brackets / semi-colons is just a personal opinion. I believe each developer should be able to choose which ones he/she leaves out in their code. Stylus allows any variation of which ones of colons / brackets / semi-colons are used or not used. It would be great if Sass could do this as well! No reason to arbitrarily choose just the latter two! 😉 |
Is it possible to ever include this? Or the developers just don't like the idea? I hate colons. |
This is not something we ever intend to add. Since Sass is designed as a superset of CSS, we try to avoid making changes to basic CSS syntax, or adding different style options that make Sass files look different from each other. |
Is there any possibility of making the colons options in Sass syntax, as in:
I've used the same in Stylus and appreciate the DRYness of it.
The text was updated successfully, but these errors were encountered: