Skip to content

Commit 980ea5e

Browse files
authored
fix(segment): piled segments under parent background, inverted variants
Whenever a piled segment is used inside a container, which has a dedicated background, the piled effect is gone. Also fixed support for inverted variants of piled, raised, stacked and floated toast-box
1 parent edf4286 commit 980ea5e

File tree

6 files changed

+56
-15
lines changed

6 files changed

+56
-15
lines changed

src/definitions/collections/form.less

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,9 +527,10 @@
527527
color: @c;
528528
}
529529

530-
// needs separate selector because not supported by every browser
531-
.ui.form .fields:has(.@{state}) > label {
532-
color: @c;
530+
@supports selector(:has(.f)) {
531+
.ui.form .fields:has(.@{state}) > label {
532+
color: @c;
533+
}
533534
}
534535

535536
.ui.form .fields.@{state} .field .ui.label,
@@ -735,9 +736,10 @@
735736
color: @lbg;
736737
}
737738

738-
// needs separate selector because not supported by every browser
739-
.ui.inverted.form .fields:has(.@{state}) > label {
740-
color: @lbg;
739+
@supports selector(:has(.f)) {
740+
.ui.inverted.form .fields:has(.@{state}) > label {
741+
color: @lbg;
742+
}
741743
}
742744
}
743745
});

src/definitions/elements/segment.less

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@
189189
margin: @piledMargin 0;
190190
box-shadow: @piledBoxShadow;
191191
z-index: @piledZIndex;
192+
background-color: @white;
193+
border: @piledBorder;
194+
color: @textColor;
192195
}
193196
.ui.piled.segment:first-child {
194197
margin-top: 0;
@@ -200,17 +203,24 @@
200203
.ui.piled.segments::before,
201204
.ui.piled.segment::after,
202205
.ui.piled.segment::before {
203-
background-color: @white;
206+
background-color: inherit;
204207
visibility: visible;
205208
content: "";
206209
display: block;
207210
height: 100%;
208211
left: 0;
209212
position: absolute;
210213
width: 100%;
211-
border: @piledBorder;
214+
border: inherit;
212215
box-shadow: @piledBoxShadow;
213216
}
217+
& when (@variationSegmentInverted) {
218+
.ui.inverted.piled.segment {
219+
background-color: @invertedBackground;
220+
border: @invertedPiledBorder;
221+
color: @invertedTextColor;
222+
}
223+
}
214224
.ui.piled.segments::before,
215225
.ui.piled.segment::before {
216226
transform: rotate(-@piledDegrees);
@@ -240,6 +250,12 @@
240250
margin-bottom: 0;
241251
}
242252
}
253+
@supports selector(:has(.f)) {
254+
*:has(> .ui.piled.segment) {
255+
z-index: 0;
256+
position: relative;
257+
}
258+
}
243259
}
244260

245261
& when (@variationSegmentStacked) {
@@ -258,7 +274,7 @@
258274
position: absolute;
259275
bottom: -(@stackedHeight / 2);
260276
left: 0;
261-
border-top: 1px solid @borderColor;
277+
border-top: @borderWidth solid @stackedBorderColor;
262278
background: @stackedPageBackground;
263279
width: 100%;
264280
height: @stackedHeight;
@@ -277,12 +293,14 @@
277293
}
278294
& when (@variationSegmentInverted) {
279295
/* Inverted */
280-
.ui.stacked.inverted.segments::before,
281-
.ui.stacked.inverted.segments::after,
282-
.ui.stacked.inverted.segment::before,
283-
.ui.stacked.inverted.segment::after {
284-
background-color: @subtleTransparentBlack;
285-
border-top: 1px solid @selectedBorderColor;
296+
.ui.stacked.inverted.segments,
297+
.ui.stacked.inverted.segment {
298+
border: @borderWidth solid @invertedStackedBorderColor;
299+
&::before,
300+
&::after {
301+
background-color: @subtleTransparentBlack;
302+
border-top: @borderWidth solid @invertedStackedBorderColor;
303+
}
286304
}
287305
}
288306
}
@@ -354,6 +372,12 @@
354372
.ui.raised.raised.segment {
355373
box-shadow: @raisedBoxShadow;
356374
}
375+
& when (@variationSegmentInverted) {
376+
.ui.inverted.raised.raised.segments,
377+
.ui.inverted.raised.raised.segment {
378+
box-shadow: @invertedRaisedBoxShadow;
379+
}
380+
}
357381
}
358382

359383
& when (@variationSegmentGroups) {

src/definitions/modules/toast.less

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@
139139
box-shadow: @floatingShadow;
140140
border: @toastBoxBorder;
141141
}
142+
& when (@variationToastInverted) {
143+
&.inverted.floating,
144+
&.inverted.hoverfloating:hover {
145+
box-shadow: @invertedFloatingShadow;
146+
border: @invertedToastBoxBorder;
147+
}
148+
}
142149
}
143150
& when (@variationToastCompact) {
144151
&.compact,

src/themes/default/elements/segment.variables

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
@piledBoxShadow: "";
6464
@piledDegrees: 1.2deg;
6565
@piledBorder: @border;
66+
@invertedPiledBorder: @borderWidth solid @solidWhiteBorderColor;
6667

6768
/* Circular */
6869
@circularPadding: 2em;
@@ -72,6 +73,8 @@
7273
@stackedPageBackground: @subtleTransparentBlack;
7374
@stackedPadding: @verticalPadding + (0.4em);
7475
@tallStackedPadding: @verticalPadding + (0.8em);
76+
@stackedBorderColor: @borderColor;
77+
@invertedStackedBorderColor: rgba(225, 225, 225, 0.5);
7578

7679
/*******************************
7780
States
@@ -92,6 +95,7 @@
9295

9396
/* Raised */
9497
@raisedBoxShadow: @floatingShadow;
98+
@invertedRaisedBoxShadow: @invertedFloatingShadow;
9599

96100
/* Padded */
97101
@paddedSegmentPadding: 1.5em;

src/themes/default/globals/site.variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,9 @@
653653
@floatingShadow:
654654
0 2px 4px 0 rgba(34, 36, 38, 0.12),
655655
0 2px 10px 0 rgba(34, 36, 38, 0.15);
656+
@invertedFloatingShadow:
657+
0 2px 4px 0 rgba(225, 225, 225, 0.1),
658+
0 2px 10px 0 rgba(225, 225, 225, 0.5);
656659

657660
/*******************************
658661
Power-User

src/themes/default/modules/toast.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
@toastInvertedColor: @black;
3737

3838
@toastBoxBorder: 1px solid rgba(34, 36, 38, 0.12);
39+
@invertedToastBoxBorder: 1px solid rgba(225, 225, 225, 0.5);
3940

4041
/* Icon */
4142
@toastIconContentPadding: 3em;

0 commit comments

Comments
 (0)