jlong/sass-bootstrap-defunct

!default

Closed this issue · 12 comments

Seems there's no need for !default in variables due to http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_defaults_.

It is used only inside _variables.scss.

What about the scenario where you want to override the default values?
On Apr 3, 2013 4:50 AM, "Damir Foy" notifications@github.com wrote:

Seems there's no need for !default in variables due to
http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variable_defaults_
.

It is used only inside _variables.scss.


Reply to this email directly or view it on GitHubhttps://github.com//issues/63
.

Well, !default seems a bit confusing, because bootstrap itself (LESS) doesn't support it.

I use !default to customize bootstrap without modifying it, how would I do if it were removed?

I wonder if it won't work without !default.

Why don't you test instead of wondering?

without default:

$pwet: 13px
$pwet: 14px
p
    font-size: $pwet

this outputs:

p {
  font-size: 14px; }

with default:

$pwet: 13px
$pwet: 14px !default
p
    font-size: $pwet

this outputs:

p {
  font-size: 13px; }

So no, it does not work, at least not for me.

So !default is needed when you prepend variables.
If you use original bootstrap, you should append them instead.
In CSS, styles are usually also appended to make sense.

This question is about habits.

!default is needed when you prepend variable definitions, so that styles in bootstrap use the custom variables. No styles are created (or appended, or prepended, or overriden). Are you okay to close this issue?

@greg0ire, I just said it. Since !default usage is quite specific, I'm closing an issue.

@damirfoy: with this last sentence, you're basically saying that styles and variables are the same thing.
To me,

/* these are variables, they do not generate any output */
$pwet: 13px
$pwet: 14px !default

/* this is a style, it uses variables to generate css rules */
p
    font-size: $pwet

Thanks for closing this issue.

Both related to final CSS, you're welcome.

And now you're saying being related to sth and being sth is the same thing.
The point I was getting to is that they're no point in appending variables because of tradition, because they are not used to generate overriding css rules: they are being used to directly modify existing sass rules.

I will note that one of the benefits of using !default is that you can just ignore the fact that it is there if you are not going to use it.

I find it useful so that I can adjust the variable values by prepending a file without having to edit any of the code from the repository (the repository is just fetched using composer and never changed directly). With the less version you need to edit variables.less to make simple value changes of colours etc., but you can still do that with _variables.scss if that is the way you want to do things. Having the option to use the available features of SASS is a good thing.