fix: allow duplicate selectors in scope, coz its safe to have them, coz hashing isnt affected by selector position

This commit is contained in:
Yiffy Dev 2024-12-13 01:26:23 +05:00 • committed by spushk
commit 337a866bfb
Signed by: spushk
GPG key ID: 7797B761E105E8AA
6 changed files with 68 additions and 11 deletions

View file

@ -0,0 +1,17 @@
.el1
color: red
&-mob
color: blue
&__blist
list-style: none
.el2
color: white
&-mob
color: black
&__blist
background: white
&-mob
background: black

View file

@ -0,0 +1,24 @@
.el1 {
color: red;
&-mob {
color: blue;
}
&__blist {
list-style: none;
}
}
.el2 {
color: white;
&-mob {
color: black;
}
&__blist {
background: white;
&-mob {
background: black;
}
}
}

View file

@ -82,6 +82,8 @@ styly!(module_usage_sass:sass "tests/assets/module-usage.sass");
styly!(module_usage_scss:scss "tests/assets/module-usage.scss");
styly!(use_forwarded_sass:sass "tests/assets/use-forwarded.sass");
styly!(use_forwarded_scss:scss "tests/assets/use-forwarded.scss");
styly!(repeating_selector_sass:sass "tests/assets/repeating-selector.sass");
styly!(repeating_selector_scss:scss "tests/assets/repeating-selector.scss");
#[test]
fn ensure_inline_matches_file() {
@ -154,9 +156,7 @@ mod build_tests {
fn gen_builder() -> SabryBuilder {
let config = gen_config();
let builder = SabryBuilder::new(config);
builder
SabryBuilder::new(config)
}
#[test]

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,7 @@
---
source: tests/macros.rs
assertion_line: 183
input_file: tests/sabry_output/scopes/repeating_selector_sass.css
snapshot_kind: text
---
.rWkBO00R__2y_lbRfXlyg.el1{color:red}.rWkBO00R__2y_lbRfXlyg.el1-mob{color:#00f}.rWkBO00R__2y_lbRfXlyg.el1__blist{list-style:none}.rWkBO00R__2y_lbRfXlyg.el2{color:#fff}.rWkBO00R__2y_lbRfXlyg.el2-mob{color:#000}.rWkBO00R__2y_lbRfXlyg.el2__blist{background:#fff}.rWkBO00R__2y_lbRfXlyg.el2__blist-mob{background:#000}

View file

@ -0,0 +1,7 @@
---
source: tests/macros.rs
assertion_line: 183
input_file: tests/sabry_output/scopes/repeating_selector_scss.css
snapshot_kind: text
---
.YYYksiQMfU3exD720ckMbA.el1{color:red}.YYYksiQMfU3exD720ckMbA.el1-mob{color:#00f}.YYYksiQMfU3exD720ckMbA.el1__blist{list-style:none}.YYYksiQMfU3exD720ckMbA.el2{color:#fff}.YYYksiQMfU3exD720ckMbA.el2-mob{color:#000}.YYYksiQMfU3exD720ckMbA.el2__blist{background:#fff}.YYYksiQMfU3exD720ckMbA.el2__blist-mob{background:#000}