-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
selectorOverrideCommentDirective
option
- Loading branch information
Showing
17 changed files
with
231 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,14 @@ | ||
#[derive(Clone)] | ||
pub(crate) struct State { | ||
pub(crate) in_less_detached_ruleset: bool, | ||
pub(crate) selector_override: SelectorOverride, | ||
} | ||
|
||
#[derive(Clone)] | ||
pub(crate) enum SelectorOverride { | ||
Unset, | ||
Ignore, | ||
Always, | ||
Consistent, | ||
Wrap, | ||
} |
9 changes: 9 additions & 0 deletions
9
malva/tests/fmt/css/block-selector-linebreak/override-always.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* malva-selector-override always */ | ||
div,span { | ||
div,span{} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: always */ | ||
div,span { | ||
div,span{} /* this shouldn't be overriden */ | ||
} |
14 changes: 14 additions & 0 deletions
14
malva/tests/fmt/css/block-selector-linebreak/override-always.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
source: malva/tests/fmt.rs | ||
--- | ||
/* malva-selector-override always */ | ||
div, | ||
span { | ||
div, span {} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: always */ | ||
div, | ||
span { | ||
div, span {} /* this shouldn't be overriden */ | ||
} |
11 changes: 11 additions & 0 deletions
11
malva/tests/fmt/css/block-selector-linebreak/override-consistent.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/*cfg blockSelectorLinebreak = "always"*/ | ||
|
||
/* malva-selector-override consistent */ | ||
div,span { | ||
div,span{} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: consistent */ | ||
div,span { | ||
div,span{} /* this shouldn't be overriden */ | ||
} |
16 changes: 16 additions & 0 deletions
16
malva/tests/fmt/css/block-selector-linebreak/override-consistent.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: malva/tests/fmt.rs | ||
--- | ||
/*cfg blockSelectorLinebreak = "always"*/ | ||
|
||
/* malva-selector-override consistent */ | ||
div, span { | ||
div, | ||
span {} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: consistent */ | ||
div, span { | ||
div, | ||
span {} /* this shouldn't be overriden */ | ||
} |
13 changes: 13 additions & 0 deletions
13
malva/tests/fmt/css/block-selector-linebreak/override-ignore.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* malva-selector-override ignore */ | ||
h1, h2, | ||
h3, h4, | ||
h5, h6 { | ||
div,span{} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: ignore */ | ||
h1, h2, | ||
h3, h4, | ||
h5, h6 { | ||
div,span{} /* this shouldn't be overriden */ | ||
} |
16 changes: 16 additions & 0 deletions
16
malva/tests/fmt/css/block-selector-linebreak/override-ignore.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
source: malva/tests/fmt.rs | ||
--- | ||
/* malva-selector-override ignore */ | ||
h1, h2, | ||
h3, h4, | ||
h5, h6 { | ||
div, span {} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: ignore */ | ||
h1, h2, | ||
h3, h4, | ||
h5, h6 { | ||
div, span {} /* this shouldn't be overriden */ | ||
} |
17 changes: 17 additions & 0 deletions
17
malva/tests/fmt/css/block-selector-linebreak/override-wrap.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/*cfg blockSelectorLinebreak = "always"*/ | ||
|
||
/* malva-selector-override wrap */ | ||
html, body, div, | ||
span, object, iframe, | ||
h1, h2, h3, h4, h5, h6, | ||
p, blockquote, pre, abbr { | ||
div,span{} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: wrap */ | ||
html, body, div, | ||
span, object, iframe, | ||
h1, h2, h3, h4, h5, h6, | ||
p, blockquote, pre, abbr { | ||
div,span{} /* this shouldn't be overriden */ | ||
} |
18 changes: 18 additions & 0 deletions
18
malva/tests/fmt/css/block-selector-linebreak/override-wrap.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
source: malva/tests/fmt.rs | ||
--- | ||
/*cfg blockSelectorLinebreak = "always"*/ | ||
|
||
/* malva-selector-override wrap */ | ||
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, | ||
pre, abbr { | ||
div, | ||
span {} /* this shouldn't be overriden */ | ||
} | ||
|
||
/* malva-selector-override: wrap */ | ||
html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, | ||
pre, abbr { | ||
div, | ||
span {} /* this shouldn't be overriden */ | ||
} |