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

Feature request: Option to remove declarations #2152

Closed
bartelsmedia opened this issue Aug 19, 2014 · 4 comments
Closed

Feature request: Option to remove declarations #2152

bartelsmedia opened this issue Aug 19, 2014 · 4 comments

Comments

@bartelsmedia
Copy link

Hello from a Less noobie,

We patch/alter the original bootstrap.less with a custom.less file

Many declarations made in the main bootstrap.less file are not required for our projects and we would like to keep the source files untouched so we can just drop in any update in the same folder without any modification.

Is there a way to tell in custom.less to remove/ignore declarations made in bootstrap.less from the compiled output?

Example:

Following declaration is defined in bootstrap.less:

@gray-darker: lighten(#000, 13.5%);

While we don't need this declaration, it will be rendered into the output.css (unless we would modify the original source bootstrap.less).

It would be nice, if a prefix, added in the custom.less, could make this declaration be removed from the output, e.g. with a leading minus char:

-@gray-darker

This would minimize the compiled .css without touching the original files. I hope this does make any sense.

@seven-phases-max
Copy link
Member

While we don't need this declaration, it will be rendered into the output.css

No, it won't. Variables are part of Less and they are not rendered into the compiled CSS (it would result in an invalid CSS if they are).

@bartelsmedia
Copy link
Author

Well, OK, it was a poor example. For the rescue, take any generated css that is generated by the bootstrap.less

Another example:

.nav-stacked {

li {
float: none;
+ li {margin-top: 2px;}
}
}

If 'prefixed' by a minus in a linked .less, the whole rule declaration set wouldn't be rendered:

-.nav-stacked {

li {
float: none;
+ li {margin-top: 2px;}
}
}

@seven-phases-max
Copy link
Member

See #1372.

@seven-phases-max
Copy link
Member

Closing as duplicate of #1372.

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