Skip to content

Commit 072e436

Browse files
committed
refactor: ♻️ add @supports at rules for non-Baseline 2024 CSS
1 parent 4b44f69 commit 072e436

File tree

16 files changed

+75
-27
lines changed

16 files changed

+75
-27
lines changed

.stylelintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
"available": "2024",
2525
"ignoreSelectors": [
2626
"nesting"
27-
],
28-
"severity": "warning"
27+
]
2928
}
3029
]
3130
}

resources/skins.citizen.styles/common/common.less

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ body {
88
min-height: ~'calc( 100vh - env( safe-area-inset-bottom,0 ) - env( safe-area-inset-top,0 ) )';
99
min-height: 100dvh;
1010
color: var( --color-base );
11-
accent-color: var( --accent-color-base );
1211
background: var( --color-surface-0 );
12+
13+
@supports ( accent-color: var( --accent-color-base ) ) {
14+
accent-color: var( --accent-color-base );
15+
}
1316
}
1417

1518
// Apply border-box universally unless overwritten
@@ -30,9 +33,11 @@ body {
3033
color: var( --color-placeholder );
3134
}
3235

33-
::selection {
34-
color: var( --color-inverted-primary );
35-
background-color: var( --color-progressive );
36+
@supports selector( ::selection ) {
37+
::selection {
38+
color: var( --color-inverted-primary );
39+
background-color: var( --color-progressive );
40+
}
3641
}
3742

3843
input,

resources/skins.citizen.styles/common/progressbar.less

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@
6767
html.citizen-loading::after {
6868
position: fixed;
6969
top: 0;
70-
}
7170

72-
@media ( display-mode: standalone ) {
7371
// Standalone PWA has no loading affordance
7472
// So we provide one
75-
html.citizen-loading::after {
73+
/* stylelint-disable-next-line plugin/use-baseline */
74+
@media ( display-mode: standalone ) {
7675
--delay-progress-bar: 0ms;
7776
}
7877
}

resources/skins.citizen.styles/common/typography.less

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@ p:not( .mw-empty-elt ) {
3737

3838
blockquote {
3939
font-style: italic;
40-
/* NOTE: This only works for Chromium browsers for now */
41-
text-wrap: pretty;
4240
.mixin-citizen-font-styles( 'body' );
4341

42+
@supports ( text-wrap: pretty ) {
43+
text-wrap: pretty;
44+
}
45+
4446
cite {
4547
font-style: normal;
4648
.mixin-citizen-font-styles( 'small' );

resources/skins.citizen.styles/common/viewTransition.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@supports ( view-transition-name: none ) {
2+
/* stylelint-disable-next-line plugin/use-baseline */
23
@view-transition {
34
navigation: auto;
45
}

resources/skins.citizen.styles/components/Menu.less

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@
55
--transform-origin-offset-start: var( --space-xs );
66
--transform-origin-offset-end: ~'calc( 100% - var( --space-xs ) )';
77
margin: var( --space-xs );
8-
user-select: none;
98
border: var( --border-width-base ) solid var( --border-color-base );
109
border-radius: var( --border-radius-medium );
1110
box-shadow: var( --box-shadow-drop-xx-large );
1211
transform: scale( 0 );
1312
contain: content;
1413
.mixin-citizen-frosted-glass( citizen-menu__card-backdrop );
1514

15+
@supports ( user-select: none ) {
16+
user-select: none;
17+
}
18+
1619
&-content {
1720
max-width: inherit;
1821
max-height: inherit;
@@ -72,7 +75,10 @@
7275
height: var( --size-icon );
7376
min-height: var( --size-icon );
7477
contain: strict;
75-
content-visibility: auto;
78+
79+
@supports ( content-visibility: auto ) {
80+
content-visibility: auto;
81+
}
7682

7783
&::before {
7884
display: block;
@@ -100,6 +106,18 @@
100106
}
101107
}
102108

109+
@supports ( user-select: none ) {
110+
.citizen-menu__card {
111+
user-select: none;
112+
}
113+
}
114+
115+
@supports ( content-visibility: auto ) {
116+
.citizen-ui-icon {
117+
content-visibility: auto;
118+
}
119+
}
120+
103121
.mw-portlet {
104122
// Hide selected item
105123
.selected {

resources/skins.citizen.styles/components/PageHeader.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
.firstHeading {
3636
margin-block: 0;
3737
line-height: 2rem; /* Reduced line height to make the heading more compact */
38-
word-break: break-word;
3938
overflow-wrap: break-word;
4039
}
4140

resources/skins.citizen.styles/components/Sections.less

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
.citizen-section {
5151
&-heading {
5252
cursor: pointer;
53-
user-select: none;
53+
54+
@supports ( user-select: none ) {
55+
user-select: none;
56+
}
5457
}
5558

5659
&-indicator {

resources/skins.citizen.styles/skinning/interface-edit-section-links.less

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@
1212
display: flex;
1313
align-items: center;
1414
margin-left: var( --space-sm );
15-
-webkit-user-select: none;
16-
user-select: none;
1715
.mixin-citizen-font-styles( 'small' );
1816

17+
@supports ( user-select: none ) {
18+
user-select: none;
19+
}
20+
21+
@supports ( -webkit-user-select: none ) {
22+
-webkit-user-select: none;
23+
}
24+
1925
.cdx-button--icon-only {
2026
span:not( .citizen-ui-icon ) {
2127
display: none;

resources/skins.citizen.styles/skinning/interface-message-box.less

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
padding: var( --space-sm ) var( --space-md );
1212
overflow: hidden;
1313
color: var( --color-emphasized );
14-
word-wrap: break-word;
15-
/* Standard property is `overflow-wrap` */
1614
overflow-wrap: break-word;
1715
background-color: var( --color-surface-2 );
1816
border: var( --border-width-base ) solid var( --border-color-base );

0 commit comments

Comments
 (0)