Skip to content

Commit 6e2fa0f

Browse files
authored
feat(lint): modernize/unify CSS but maintain IE11 compatibility
Fix several stylelint stylelint-config-standard config advisories.
1 parent 70adac5 commit 6e2fa0f

File tree

26 files changed

+104
-138
lines changed

26 files changed

+104
-138
lines changed

.stylelintrc.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@ module.exports = {
1111
'at-rule-empty-line-before': null,
1212
'at-rule-name-case': null,
1313
'at-rule-no-unknown': null,
14+
'block-no-empty': null,
1415
'color-function-notation': 'legacy',
1516
'color-hex-case': 'lower',
1617
'declaration-colon-newline-after': null, // handled by Prettier
18+
'font-family-no-missing-generic-family-keyword': null,
1719
'function-no-unknown': null,
1820
'import-notation': null,
1921
indentation: null, // handled by Prettier
22+
'keyframes-name-pattern': null,
2023
linebreaks: 'unix',
2124
'max-line-length': null,
2225
'no-descending-specificity': null,
@@ -39,21 +42,7 @@ module.exports = {
3942
// TODO rules to be removed/fixed in v2.10.0 as fixes are not compatible with IE11
4043
'alpha-value-notation': 'number', // https://caniuse.com/mdn-css_properties_opacity_percentages
4144
'selector-not-notation': null, // https://caniuse.com/css-not-sel-list
42-
43-
// TODO
44-
'keyframes-name-pattern': null, // 50 errors
45-
'block-no-empty': null, // 25 errors
46-
'selector-no-vendor-prefix': null, // 19 errors
47-
'selector-class-pattern': null, // 19 errors
48-
'declaration-block-no-redundant-longhand-properties': null, // 12 errors
49-
'value-no-vendor-prefix': null, // 9 errors
50-
'font-family-no-missing-generic-family-keyword': null, // 8 errors
51-
'shorthand-property-no-redundant-values': null, // 5 errors
52-
'declaration-block-no-duplicate-properties': null, // 2 errors
53-
'font-family-no-duplicate-names': null, // 2 errors
54-
'function-linear-gradient-no-nonstandard-direction': null, // 1 error
55-
'at-rule-no-vendor-prefix': null, // 1 error
56-
'declaration-block-no-shorthand-property-overrides': null, // 1 error
45+
'selector-no-vendor-prefix': null,
5746
},
5847
reportNeedlessDisables: true,
5948
};

src/definitions/collections/breadcrumb.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
.ui.breadcrumb .divider {
4343
display: inline-block;
4444
opacity: @dividerOpacity;
45-
margin: 0 @dividerSpacing 0;
45+
margin: 0 @dividerSpacing;
4646
font-size: @dividerSize;
4747
color: @dividerColor;
4848
vertical-align: @dividerVerticalAlign;

src/definitions/collections/grid.less

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323

2424
.ui.grid {
2525
display: flex;
26-
flex-direction: row;
27-
flex-wrap: wrap;
26+
flex-flow: row wrap;
2827
align-items: stretch;
2928
padding: 0;
3029
}
@@ -34,10 +33,7 @@
3433
----------------------- */
3534

3635
.ui.grid {
37-
margin-top: -(@rowSpacing / 2);
38-
margin-bottom: -(@rowSpacing / 2);
39-
margin-left: -(@gutterWidth / 2);
40-
margin-right: -(@gutterWidth / 2);
36+
margin: -(@rowSpacing / 2) -(@gutterWidth / 2);
4137
}
4238
& when (@variationGridRelaxed) {
4339
.ui.relaxed.grid {
@@ -84,8 +80,7 @@
8480
.ui.grid > .row {
8581
position: relative;
8682
display: flex;
87-
flex-direction: row;
88-
flex-wrap: wrap;
83+
flex-flow: row wrap;
8984
justify-content: inherit;
9085
align-items: stretch;
9186
width: 100% !important;
@@ -1696,7 +1691,7 @@
16961691
.ui.stackable.grid > .column:not(.row),
16971692
.ui.grid > .stackable.stackable.stackable.row > .column {
16981693
width: 100% !important;
1699-
margin: 0 0 !important;
1694+
margin: 0 !important;
17001695
box-shadow: none !important;
17011696
padding: (@stackableRowSpacing / 2) (@stackableGutter / 2);
17021697
}
@@ -1908,10 +1903,7 @@
19081903

19091904
/* Row */
19101905
.ui.ui.ui.compact.grid > .row {
1911-
padding-top: (@compactRowSpacing / 2);
1912-
padding-bottom: (@compactRowSpacing / 2);
1913-
padding-left: 0;
1914-
padding-right: 0;
1906+
padding: (@compactRowSpacing / 2) 0;
19151907
}
19161908

19171909
/* Columns */
@@ -1955,10 +1947,7 @@
19551947

19561948
/* Row */
19571949
.ui.ui.ui[class*="very compact"].grid > .row {
1958-
padding-top: (@veryCompactRowSpacing / 2);
1959-
padding-bottom: (@veryCompactRowSpacing / 2);
1960-
padding-left: 0;
1961-
padding-right: 0;
1950+
padding: (@veryCompactRowSpacing / 2) 0;
19621951
}
19631952

19641953
/* Columns */

src/definitions/collections/menu.less

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -962,13 +962,11 @@ Floated Menu / Item
962962
}
963963

964964
.ui.secondary.pointing.menu .item {
965-
border-bottom-color: transparent;
966-
border-bottom-style: solid;
965+
border-bottom: @secondaryPointingBorderWidth solid transparent;
967966
border-radius: 0;
968967
align-self: flex-end;
969968
margin: 0 0 -@secondaryPointingBorderWidth;
970969
padding: @secondaryPointingItemVerticalPadding @secondaryPointingItemHorizontalPadding;
971-
border-bottom-width: @secondaryPointingBorderWidth;
972970
transition: @secondaryItemTransition;
973971
}
974972
.ui.secondary.pointing.menu .ui.dropdown .menu .item {
@@ -1034,17 +1032,13 @@ Floated Menu / Item
10341032
/* Vertical Pointing */
10351033
.ui.secondary.vertical.pointing.menu {
10361034
border-bottom-width: 0;
1037-
border-right-width: @secondaryPointingBorderWidth;
1038-
border-right-style: solid;
1039-
border-right-color: @secondaryPointingBorderColor;
1035+
border-right: @secondaryPointingBorderWidth solid @secondaryPointingBorderColor;
10401036
}
10411037
.ui.secondary.vertical.pointing.menu .item {
10421038
border-bottom: none;
1043-
border-right-style: solid;
1044-
border-right-color: transparent;
1039+
border-right: @secondaryPointingBorderWidth solid transparent;
10451040
border-radius: 0 !important;
10461041
margin: @secondaryVerticalPointingItemMargin;
1047-
border-right-width: @secondaryPointingBorderWidth;
10481042
}
10491043

10501044
/* Vertical Active */
@@ -1590,6 +1584,7 @@ Floated Menu / Item
15901584
.ui.compact.vertical.menu {
15911585
& when (@supportIE) {
15921586
/* IE hack to make dropdown icons appear inline */
1587+
// stylelint-disable-next-line value-no-vendor-prefix
15931588
display: -ms-inline-flexbox !important;
15941589
}
15951590

src/definitions/collections/table.less

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,6 @@
18141814
& when (@variationTableStuckHead) or (@variationTableStuckFoot) {
18151815
.ui.head.stuck.table > thead,
18161816
.ui.foot.stuck.table > tfoot {
1817-
position: -webkit-sticky;
18181817
position: sticky;
18191818
z-index: @stuckZIndex;
18201819
}
@@ -1854,7 +1853,6 @@
18541853
border-left: 0;
18551854
& th:first-child,
18561855
td:first-child {
1857-
position: -webkit-sticky;
18581856
position: sticky;
18591857
left: 0;
18601858
border-left: @cellBorder;
@@ -1872,7 +1870,6 @@
18721870
border-right: 0;
18731871
& th:last-child,
18741872
td:last-child {
1875-
position: -webkit-sticky;
18761873
position: sticky;
18771874
right: 0;
18781875
border-right: @cellBorder;

src/definitions/elements/button.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@
704704

705705
.ui.compact.labeled.icon.buttons .button > .icon,
706706
.ui.compact.labeled.icon.button > .icon {
707-
padding: @compactVerticalPadding 0 @compactVerticalPadding 0;
707+
padding: @compactVerticalPadding 0;
708708
}
709709
}
710710

@@ -1005,7 +1005,7 @@
10051005
border-bottom-left-radius: inherit;
10061006
text-align: center;
10071007
animation: none;
1008-
padding: @verticalPadding 0 @verticalPadding 0;
1008+
padding: @verticalPadding 0;
10091009
margin: @labeledIconMargin;
10101010
width: @labeledIconWidth;
10111011
background-color: @labeledIconBackgroundColor;

src/definitions/elements/divider.less

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,7 @@
232232
.ui.divider.inverted,
233233
.ui.divider.inverted::after,
234234
.ui.divider.inverted::before {
235-
border-top-color: @invertedShadowColor !important;
236-
border-left-color: @invertedShadowColor !important;
237-
border-bottom-color: @invertedHighlightColor !important;
238-
border-right-color: @invertedHighlightColor !important;
235+
border-color: @invertedShadowColor @invertedHighlightColor @invertedHighlightColor @invertedShadowColor !important;
239236
}
240237
}
241238

src/definitions/elements/header.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
.ui.attached.header {
449449
background: @attachedBackground;
450450
padding: @attachedVerticalPadding @attachedHorizontalPadding;
451-
margin: 0 @attachedOffset 0 @attachedOffset;
451+
margin: 0 @attachedOffset;
452452
box-shadow: @attachedBoxShadow;
453453
border: @attachedBorder;
454454
border-radius: 0;

src/definitions/elements/image.less

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ img.ui.image {
256256
}
257257
.ui.centered.images {
258258
display: flex;
259-
flex-direction: row;
260-
flex-wrap: wrap;
259+
flex-flow: row wrap;
261260
align-items: stretch;
262261
justify-content: center;
263262
}
@@ -297,7 +296,7 @@ img.ui.image {
297296

298297
.ui.images {
299298
font-size: 0;
300-
margin: 0 -@imageHorizontalMargin 0;
299+
margin: 0 -@imageHorizontalMargin;
301300
}
302301

303302
.ui.images .image,

src/definitions/elements/label.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,6 @@ a.ui.active.label:hover::before {
899899
.ui[class*="bottom pointing"].label::before,
900900
.ui[class*="pointing below"].label::before {
901901
border-width: 0 @borderWidth @borderWidth 0;
902-
top: auto;
903902
right: auto;
904903
transform: translateX(-50%) translateY(-50%) rotate(45deg);
905904
top: 100%;

0 commit comments

Comments
 (0)