Skip to content

Commit 954ccfe

Browse files
committed
feat: replace colon ':' with underscore (_) for responsive classes
1 parent 205fa02 commit 954ccfe

File tree

6 files changed

+83
-80
lines changed

6 files changed

+83
-80
lines changed

css/css-classes.generated.css

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,27 +58,27 @@
5858
.width-half {}
5959
.width-quarter {}
6060
.width-third {}
61-
.sm:hidden-yes {}
62-
.sm:hidden-no {}
63-
.sm:width-full {}
64-
.sm:width-half {}
65-
.sm:width-quarter {}
66-
.sm:width-third {}
67-
.md:hidden-yes {}
68-
.md:hidden-no {}
69-
.md:width-full {}
70-
.md:width-half {}
71-
.md:width-quarter {}
72-
.md:width-third {}
73-
.lg:hidden-yes {}
74-
.lg:hidden-no {}
75-
.lg:width-full {}
76-
.lg:width-half {}
77-
.lg:width-quarter {}
78-
.lg:width-third {}
79-
.xl:hidden-yes {}
80-
.xl:hidden-no {}
81-
.xl:width-full {}
82-
.xl:width-half {}
83-
.xl:width-quarter {}
84-
.xl:width-third {}
61+
.sm_hidden-yes {}
62+
.sm_hidden-no {}
63+
.sm_width-full {}
64+
.sm_width-half {}
65+
.sm_width-quarter {}
66+
.sm_width-third {}
67+
.md_hidden-yes {}
68+
.md_hidden-no {}
69+
.md_width-full {}
70+
.md_width-half {}
71+
.md_width-quarter {}
72+
.md_width-third {}
73+
.lg_hidden-yes {}
74+
.lg_hidden-no {}
75+
.lg_width-full {}
76+
.lg_width-half {}
77+
.lg_width-quarter {}
78+
.lg_width-third {}
79+
.xl_hidden-yes {}
80+
.xl_hidden-no {}
81+
.xl_width-full {}
82+
.xl_width-half {}
83+
.xl_width-quarter {}
84+
.xl_width-third {}

css/utils.css

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/utils.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gorko/src/mixins/_generate-utility-classes.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111

1212
/// For each breakpoint, generate a prefix and run the cycle
1313
@each $key, $value in map-get($gorko-config, 'breakpoints') {
14-
$prefix: #{$key + '\\:'};
14+
/// we need to use _ instead of : because of upstream prefixing problem with rollup + postcss
15+
$prefix: #{$key + '_'};
1516
$is-breakpoint: true;
1617

1718
@media #{$value} {

public/utils.css

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ Most of them are just tokens abstractions but they fell in category of 'utility
77

88
Proper utility classes just as in programing do one thing and do it well. `.visually-hidden` for example.
99

10-
## Media Queries
10+
## Media Queries & Responsive classes
1111

12-
> Following media queries are used to generate 'responsive' utility classes,
13-
> when you see 'responsive' in table of property, you can use it as per example
12+
> Following media queries are used to generate 'responsive' utility classes.
13+
> When you see 'responsive' in table of property, you can use it as per example
14+
> NOTE: typically you would use colon `:` for responsive classes, but in our case
15+
> combination rollup + postcss didn't allow us to do so, hence chose `_`;
1416
1517
- sm: (min-width: 48em)
1618
- md: (min-width: 62em)
1719
- lg: (min-width: 75em)
1820
- xl: (min-width: 90em)
1921

2022
```jsx
21-
<div className="lg:hidden-yes">
23+
<div className="lg_hidden-yes">
2224
<p>You will not be able to see me on large screens</p>
2325
</div>
2426
```
@@ -32,7 +34,7 @@ Proper utility classes just as in programing do one thing and do it well. `.visu
3234

3335
| Property | Value | Details |
3436
| ---------- | ----- | --------------- |
35-
| Responsive | Yes | `lg:hidden-yes` |
37+
| Responsive | Yes | `lg_hidden-yes` |
3638

3739
## Gutter:
3840

@@ -170,5 +172,5 @@ Proper utility classes just as in programing do one thing and do it well. `.visu
170172

171173
| Property | Value | Details |
172174
| ---------- | ----- | ---------------- |
173-
| Responsive | Yes | `sm:width-half` |
175+
| Responsive | Yes | `sm_width-half` |
174176
| Fluid | Yes | uses percentages |

0 commit comments

Comments
 (0)