Skip to content

Commit

Permalink
- fix _g-* for only-child scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
zbryikt committed Feb 13, 2022
1 parent fca6478 commit fc07abe
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 23 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Logs

## v0.0.6

- fix `_g-*` for only-child scenario


## v0.0.5

- add `_g-*` for partially flexbox gap polyfill
Expand Down
32 changes: 26 additions & 6 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,19 +520,29 @@ a.disabled {
._g-2 > *,
._g-3 > *,
._g-4 > * {
margin: 0 var(--gap);
margin-left: var(--gap);
margin-right: var(--gap);
}
._g-1 > *:first-child,
._g-2 > *:first-child,
._g-3 > *:first-child,
._g-4 > *:first-child {
margin: 0 var(--gap) 0 0;
margin-left: 0;
margin-right: var(--gap);
}
._g-1 > *:last-child,
._g-2 > *:last-child,
._g-3 > *:last-child,
._g-4 > *:last-child {
margin: 0 0 0 var(--gap);
margin-left: var(--gap);
margin-right: 0;
}
._g-1 > *:only-child,
._g-2 > *:only-child,
._g-3 > *:only-child,
._g-4 > *:only-child {
margin-left: 0 !important;
margin-right: 0 !important;
}
._g-1.flex-column,
._g-2.flex-column,
Expand All @@ -544,19 +554,29 @@ a.disabled {
._g-2.flex-column > *,
._g-3.flex-column > *,
._g-4.flex-column > * {
margin: var(--gap) 0;
margin-top: var(--gap);
margin-bottom: var(--gap);
}
._g-1.flex-column > *:first-child,
._g-2.flex-column > *:first-child,
._g-3.flex-column > *:first-child,
._g-4.flex-column > *:first-child {
margin: 0 0 var(--gap) 0;
margin-top: 0;
margin-bottom: var(--gap);
}
._g-1.flex-column > *:last-child,
._g-2.flex-column > *:last-child,
._g-3.flex-column > *:last-child,
._g-4.flex-column > *:last-child {
margin: var(--gap) 0 0 0;
margin-top: var(--gap);
margin-bottom: 0;
}
._g-1.flex-column > *:only-child,
._g-2.flex-column > *:only-child,
._g-3.flex-column > *:only-child,
._g-4.flex-column > *:only-child {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
@media (max-width: 1200px) {
.w-1200.rwd {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@loadingio/bootstrap.ext",
"license": "MIT",
"description": "bootstrap extension used by loading.io",
"version": "0.0.5",
"version": "0.0.6",
"style": "dist/index.min.css",
"files": [
"dist/**/*"
Expand Down
14 changes: 8 additions & 6 deletions src/styl/layout.styl
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@

._g-1, ._g-2, ._g-3, ._g-4
gap: 0
& > * { margin: 0 var(--gap) }
& > *:first-child { margin: 0 var(--gap) 0 0 }
& > *:last-child { margin: 0 0 0 var(--gap) }
& > * { margin-left: var(--gap); margin-right: var(--gap); }
& > *:first-child { margin-left: 0; margin-right: var(--gap) }
& > *:last-child { margin-left: var(--gap); margin-right: 0 }
& > *:only-child { margin-left: 0!important; margin-right: 0!important }

._g-1.flex-column, ._g-2.flex-column, ._g-3.flex-column, ._g-4.flex-column
gap: 0
& > * { margin: var(--gap) 0 }
& > *:first-child { margin: 0 0 var(--gap) 0 }
& > *:last-child { margin: var(--gap) 0 0 0 }
& > * { margin-top: var(--gap); margin-bottom: var(--gap); }
& > *:first-child { margin-top: 0; margin-bottom: var(--gap) }
& > *:last-child { margin-top: var(--gap); margin-bottom: 0 }
& > *:only-child { margin-top: 0!important; margin-bottom: 0!important }


@media (max-width: 1200px) { .w-1200.rwd { width: 90%; margin: auto; } }
Expand Down
32 changes: 26 additions & 6 deletions web/static/assets/lib/@loadingio/bootstrap.ext/dev/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -520,19 +520,29 @@ a.disabled {
._g-2 > *,
._g-3 > *,
._g-4 > * {
margin: 0 var(--gap);
margin-left: var(--gap);
margin-right: var(--gap);
}
._g-1 > *:first-child,
._g-2 > *:first-child,
._g-3 > *:first-child,
._g-4 > *:first-child {
margin: 0 var(--gap) 0 0;
margin-left: 0;
margin-right: var(--gap);
}
._g-1 > *:last-child,
._g-2 > *:last-child,
._g-3 > *:last-child,
._g-4 > *:last-child {
margin: 0 0 0 var(--gap);
margin-left: var(--gap);
margin-right: 0;
}
._g-1 > *:only-child,
._g-2 > *:only-child,
._g-3 > *:only-child,
._g-4 > *:only-child {
margin-left: 0 !important;
margin-right: 0 !important;
}
._g-1.flex-column,
._g-2.flex-column,
Expand All @@ -544,19 +554,29 @@ a.disabled {
._g-2.flex-column > *,
._g-3.flex-column > *,
._g-4.flex-column > * {
margin: var(--gap) 0;
margin-top: var(--gap);
margin-bottom: var(--gap);
}
._g-1.flex-column > *:first-child,
._g-2.flex-column > *:first-child,
._g-3.flex-column > *:first-child,
._g-4.flex-column > *:first-child {
margin: 0 0 var(--gap) 0;
margin-top: 0;
margin-bottom: var(--gap);
}
._g-1.flex-column > *:last-child,
._g-2.flex-column > *:last-child,
._g-3.flex-column > *:last-child,
._g-4.flex-column > *:last-child {
margin: var(--gap) 0 0 0;
margin-top: var(--gap);
margin-bottom: 0;
}
._g-1.flex-column > *:only-child,
._g-2.flex-column > *:only-child,
._g-3.flex-column > *:only-child,
._g-4.flex-column > *:only-child {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
@media (max-width: 1200px) {
.w-1200.rwd {
Expand Down

Large diffs are not rendered by default.

0 comments on commit fc07abe

Please sign in to comment.