Skip to content
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

Remove Boolean, Number and complex String values from options dealing with whitespaces #116

Closed
tonyganch opened this issue Nov 20, 2013 · 1 comment
Assignees
Milestone

Comments

@tonyganch
Copy link
Member

I propose removing Boolean values from all options dealing with whitespaces, because the only thing they do is that they confuse.

  • block-indent: true means 4 spaces
  • colon-space: true means no space before : and 1 space after
  • combinator-space: true means 1 space before and 1 space after
  • rule-indent: true means 4 spaces
  • stick-brace: true means 1 space before {

Also I think that values like colon-space: ' : ' should be removed in favour of arrays: colon-space: [' ', ' '].

I also propose removing Number values, replacing block-indent: 4 with block-indent: ' '.

@kizu
Copy link
Contributor

kizu commented Nov 20, 2013

I agree that we should generalize and normalize all the values that our options can have.

A agree that we can remove Boolean values (as confusing) and complex ones (we already have arrays and would have proper detection).

However, I'd save numeric ones, 'cause they always would be equal to the space repeated the given number of times.

Also, I find the arrays confusing now.

And after some thoughts I'd say we need to remove the Arrays and then split and rename some options (hello, #92, I guess I'll rewrite you again soon). The main thing we need to do is to rename the “space” options like this:

  • space-before-colon
  • space-after-color
  • space-around-combinator
  • space-before-curly-brace
  • space-after-curly-brace
  • etc…

Things that have multiple values inside (like combinator-space/space-around-combinator) should only be there when in most cases all the values inside them would be the same. Also, I'd prefer hashes instead of arrays if we'd need to set the before and after individually, so you could say "space-around-combinator": { "before": " ", "after": "\n\t" } for example. This way it would be better understandable.

While this kind of naming could seem too verbose, it would be:

  1. More readable and less confusing. All the whitespace options could be started with space-, for example.
  2. When the Detection of existent codestyle #87 would ship it won't matter much that the names are long: you could either write your options as CSS, you could generate the json from CSS, or just look up into the man to know which option to use.

Anyway, it won't be more confusing than now.

So, to sum up: all the options should be named in similar more understandable way and have only three possible types of values (two for most of them): String containing whitespaces, Number as \s{%Number%}, and Object for those options like combinator-space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants