Skip to content

Commit

Permalink
fix: postcss-for (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
axyz authored Mar 9, 2021
1 parent 3a01728 commit 2c5e325
Show file tree
Hide file tree
Showing 23 changed files with 360 additions and 592 deletions.
2 changes: 1 addition & 1 deletion integration-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "atomic start"
},
"devDependencies": {
"@utilitycss/postcss-for": "^0.0.2",
"@utilitycss/postcss-for": "^0.0.3",
"lerna": "3.13.3",
"postcss-css-variables": "^0.17.0",
"postcss-nested": "^5.0.3",
Expand Down
34 changes: 30 additions & 4 deletions integration-test/packages/atoms/all/atom.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ a:hover {
color: red
}

.AkiP_t .l-e8AL {
.AkiP_t .l-e8AL,
.AkiP_t .B_oqE3 {
color: blue;
}

Expand Down Expand Up @@ -192,6 +193,28 @@ a:hover {
.hg64jR {
font-size: 4em;
}
@keyframes btLJzz {
0%,
10% {
opacity: 0;
}
15% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}

.btLJzz {
animation-duration: 250ms;
animation-name: btLJzz;
}

._8_jRhp {
animation-duration: 250ms;
animation-name: btLJzz;
}
.global-class {
width: 100%;
}
Expand All @@ -204,15 +227,18 @@ a:hover {
color: blue;
}

.oPlD0W{
.oPlD0W,
.NRaoKv {
font-size: 1em;
}

.FCG5GQ{
.FCG5GQ,
.H9WShg {
font-size: 2em;
}

.d8yso7{
.d8yso7,
.uGM3oi {
font-size: 3em;
}

Expand Down
2 changes: 1 addition & 1 deletion integration-test/packages/atoms/all/atom.min.css.snap

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion integration-test/packages/atoms/for/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@for $i from 1 to 3 {
.size_$(i){
.size_$(i),
.size_$(i)_sibling {
font-size: $(i)em;
}
}
Expand Down
5 changes: 4 additions & 1 deletion integration-test/packages/atoms/for/index.d.ts.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
declare const size_1: string;
declare const size_1_sibling: string;
declare const size_2: string;
declare const size_2_sibling: string;
declare const size_3: string;
declare const size_3_sibling: string;
declare const calc1: string;
declare const child_1_1: string;
declare const modifier_1_1: string;
Expand All @@ -22,4 +25,4 @@ declare const child_3_2: string;
declare const modifier_3_2: string;
declare const child_3_3: string;
declare const modifier_3_3: string
export { size_1, size_2, size_3, calc1, child_1_1, modifier_1_1, child_1_2, modifier_1_2, child_1_3, modifier_1_3, calc2, child_2_1, modifier_2_1, child_2_2, modifier_2_2, child_2_3, modifier_2_3, calc3, child_3_1, modifier_3_1, child_3_2, modifier_3_2, child_3_3, modifier_3_3 }
export { size_1, size_1_sibling, size_2, size_2_sibling, size_3, size_3_sibling, calc1, child_1_1, modifier_1_1, child_1_2, modifier_1_2, child_1_3, modifier_1_3, calc2, child_2_1, modifier_2_1, child_2_2, modifier_2_2, child_2_3, modifier_2_3, calc3, child_3_1, modifier_3_1, child_3_2, modifier_3_2, child_3_3, modifier_3_3 }
2 changes: 1 addition & 1 deletion integration-test/packages/atoms/for/module.css.json.snap
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"size_1":"oPlD0W","size_2":"FCG5GQ","size_3":"d8yso7","calc1":"_8N2ZPM","child_1_1":"_8Urr0R","modifier_1_1":"e2agTq","child_1_2":"vlAfUd","modifier_1_2":"PgUB93","child_1_3":"utNk9X","modifier_1_3":"bwOLNP","calc2":"Xj0KNQ","child_2_1":"SnZr3u","modifier_2_1":"tNdUvj","child_2_2":"bUAlDZ","modifier_2_2":"lpuLLH","child_2_3":"MdYjYw","modifier_2_3":"YK_gQZ","calc3":"mUzFkS","child_3_1":"KCb6ES","modifier_3_1":"_2PGpjA","child_3_2":"_4_kJbH","modifier_3_2":"eCH6U5","child_3_3":"LSjKrm","modifier_3_3":"RYF8kF"}
{"size_1":"oPlD0W","size_1_sibling":"NRaoKv","size_2":"FCG5GQ","size_2_sibling":"H9WShg","size_3":"d8yso7","size_3_sibling":"uGM3oi","calc1":"_8N2ZPM","child_1_1":"_8Urr0R","modifier_1_1":"e2agTq","child_1_2":"vlAfUd","modifier_1_2":"PgUB93","child_1_3":"utNk9X","modifier_1_3":"bwOLNP","calc2":"Xj0KNQ","child_2_1":"SnZr3u","modifier_2_1":"tNdUvj","child_2_2":"bUAlDZ","modifier_2_2":"lpuLLH","child_2_3":"MdYjYw","modifier_2_3":"YK_gQZ","calc3":"mUzFkS","child_3_1":"KCb6ES","modifier_3_1":"_2PGpjA","child_3_2":"_4_kJbH","modifier_3_2":"eCH6U5","child_3_3":"LSjKrm","modifier_3_3":"RYF8kF"}
9 changes: 6 additions & 3 deletions integration-test/packages/atoms/for/module.css.snap
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
.size_1{
.size_1,
.size_1_sibling {
font-size: 1em;
}

.size_2{
.size_2,
.size_2_sibling {
font-size: 2em;
}

.size_3{
.size_3,
.size_3_sibling {
font-size: 3em;
}

Expand Down
9 changes: 6 additions & 3 deletions integration-test/packages/atoms/for/result.css.snap
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
.oPlD0W{
.oPlD0W,
.NRaoKv {
font-size: 1em;
}

.FCG5GQ{
.FCG5GQ,
.H9WShg {
font-size: 2em;
}

.d8yso7{
.d8yso7,
.uGM3oi {
font-size: 3em;
}

Expand Down
3 changes: 3 additions & 0 deletions integration-test/packages/atoms/keyframes/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*.tsx
**/*.ts
!**/*.d.ts
22 changes: 22 additions & 0 deletions integration-test/packages/atoms/keyframes/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@keyframes fade-in {
0%,
10% {
opacity: 0;
}
15% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}

.fade-in {
animation-duration: 250ms;
animation-name: fade-in;
}

.alias {
animation-duration: 250ms;
animation-name: fade-in;
}
3 changes: 3 additions & 0 deletions integration-test/packages/atoms/keyframes/index.d.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
declare const fade-in: string;
declare const alias: string
export { fade-in, alias }
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"fade-in":"btLJzz","alias":"_8_jRhp"}
22 changes: 22 additions & 0 deletions integration-test/packages/atoms/keyframes/module.css.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@keyframes fade-in {
0%,
10% {
opacity: 0;
}
15% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}

.fade-in {
animation-duration: 250ms;
animation-name: fade-in;
}

.alias {
animation-duration: 250ms;
animation-name: fade-in;
}
6 changes: 6 additions & 0 deletions integration-test/packages/atoms/keyframes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@my-org/keyframes",
"version": "0.0.1",
"main": "module.css.json",
"sideEffects": false
}
22 changes: 22 additions & 0 deletions integration-test/packages/atoms/keyframes/result.css.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
@keyframes btLJzz {
0%,
10% {
opacity: 0;
}
15% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}

.btLJzz {
animation-duration: 250ms;
animation-name: btLJzz;
}

._8_jRhp {
animation-duration: 250ms;
animation-name: btLJzz;
}
3 changes: 2 additions & 1 deletion integration-test/packages/atoms/nested/index.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.single-nesting {
color: red;

.child {
.child,
.sibling {
color: blue;
}
}
Expand Down
3 changes: 2 additions & 1 deletion integration-test/packages/atoms/nested/index.d.ts.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
declare const single-nesting: string;
declare const child: string;
declare const sibling: string;
declare const deep-nesting: string;
declare const grandchild: string;
declare const class-combination: string;
Expand All @@ -10,4 +11,4 @@ declare const nested: string;
declare const nested-pseudo: string;
declare const hover-child: string;
declare const hover-child-modifier: string
export { single-nesting, child, deep-nesting, grandchild, class-combination, modifier, complex, child-modifier, nested, nested-pseudo, hover-child, hover-child-modifier }
export { single-nesting, child, sibling, deep-nesting, grandchild, class-combination, modifier, complex, child-modifier, nested, nested-pseudo, hover-child, hover-child-modifier }
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"single-nesting":"AkiP_t","child":"l-e8AL","deep-nesting":"pBcZ8q","grandchild":"oLzZ_N","class-combination":"Vsez8s","modifier":"onlaI8","complex":"HbTeo6","child-modifier":"IEmj7p","nested":"vruPji","nested-pseudo":"DG8Mjh","hover-child":"PH_qY8","hover-child-modifier":"Tmf42F"}
{"single-nesting":"AkiP_t","child":"l-e8AL","sibling":"B_oqE3","deep-nesting":"pBcZ8q","grandchild":"oLzZ_N","class-combination":"Vsez8s","modifier":"onlaI8","complex":"HbTeo6","child-modifier":"IEmj7p","nested":"vruPji","nested-pseudo":"DG8Mjh","hover-child":"PH_qY8","hover-child-modifier":"Tmf42F"}
3 changes: 2 additions & 1 deletion integration-test/packages/atoms/nested/module.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
color: red
}

.single-nesting .child {
.single-nesting .child,
.single-nesting .sibling {
color: blue;
}

Expand Down
3 changes: 2 additions & 1 deletion integration-test/packages/atoms/nested/result.css.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
color: red
}

.AkiP_t .l-e8AL {
.AkiP_t .l-e8AL,
.AkiP_t .B_oqE3 {
color: blue;
}

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@utilitycss/atomic",
"version": "0.15.0",
"version": "0.15.1",
"author": "Andrea Moretti (@axyz) <[email protected]>",
"description": "Atomic CSS composition for yarn workspaces",
"repository": "utilitycss/atomic",
Expand Down Expand Up @@ -28,12 +28,12 @@
"chokidar": "^3.5.1",
"clear": "^0.1.0",
"commander": "^7.1.0",
"cssnano": "5.0.0-rc.0",
"cssnano-preset-advanced": "^4.0.7",
"cssnano": "5.0.0-rc.1",
"cssnano-preset-advanced": "^5.0.0-rc.1",
"figlet": "^1.5.0",
"handlebars": "^4.7.7",
"inquirer": "^7.3.3",
"postcss-discard-empty": "^5.0.0-rc.0",
"postcss-discard-empty": "^5.0.0-rc.1",
"postcss-modules": "^4.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion templates/package.json.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"start": "atomic start"
},
"devDependencies": {
"@utilitycss/atomic": "^0.15.0",
"@utilitycss/atomic": "^0.15.1",
"lerna": "3.13.3"
},
"workspaces": {
Expand Down
Loading

0 comments on commit 2c5e325

Please sign in to comment.