-
Notifications
You must be signed in to change notification settings - Fork 320
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
Ignore specific styles #895
Comments
This is an interesting concept! So given this input: .block-1 {
color: #f00;
}
/* #clean-css: ignore */
.ignore-me {
color: transparent;
}
/* #clean-css: /ignore */
.block-2 {
margin: 0px;
} should the output (let's assume we use .block-1{color:red}
/* #clean-css: ignore */
.ignore-me{color:transparent}
/* #clean-css: /ignore */
.block-2{margin:0} ? Should this mechanism:
|
@jakubpawlowicz - Cześć :) +1 to that, it would be great to just keep some sections not parsed at all, content between tags should just be passed as raw css. |
@studio404pl hej! :-) Do you think the output should still contain the |
@jakubpawlowicz i think syntax that you suggested is ok. IMHO this condition's comments should not be included in parsed file. |
Ok, thanks for input! |
In my opinion, it would be nice to not only to set ignore option per block but also other options like the aforementioned 'format: |
@strarsis we'll start with something simple here as having a per-block options would bump the complexity greatly. |
@jakubpawlowicz Any updates on when can it be ready or how to help with bringing that functionality? But have one proposal - let's use comment naming standard set by jshint as it's quite recognisable, link (under "ignore" title). So example will look like this: .block-1{color:red}
/* clean-css ignore:start */
.ignore-me{color:transparent}
/* clean-css ignore:end */
.block-2{margin:0} And I guess we can think of introducing single-line ignore-comments as well, but initially, it's not necessary. |
I think we can have it in 4.2 but I need to dig how complex it is first. @strarsis @studio404pl what do you think about ^ suggestion re comment naming? |
Why: * Allows parts of CSS document to be wrapped between /* clean-css ignore:start */ and /* clean-css ignore:end */ comments passing them to output untouched by parsing and optimizing; * in case of some special stylesheets when optimizations can break styling.
^ the preliminary version supporting the |
Why: * Allows parts of CSS document to be wrapped between /* clean-css ignore:start */ and /* clean-css ignore:end */ comments passing them to output untouched by parsing and optimizing; * in case of some special stylesheets when optimizations can break styling.
Why: * Allows parts of CSS document to be wrapped between /* clean-css ignore:start */ and /* clean-css ignore:end */ comments passing them to output untouched by parsing and optimizing; * in case of some special stylesheets when optimizations can break styling.
Added in master, scheduled for 4.2 release. |
It would be nice to let clean-css skip specific rulesets/declarations/blocks e.g. by
surrounding them with terminated comments, e.g.:
The text was updated successfully, but these errors were encountered: