Skip to content

Commit 9bf5e5c

Browse files
authored
feat(modal): basic header and basic left actions
Added a basic variant for header and actions of a modal which removes the separate background and border separator Added left variant for actions which displays the action buttons to the left (we already have this for toast) i also added some more options for variation switches to possibly reduce more css output if people dont need the actions or left/centered variants
1 parent ed8b4dc commit 9bf5e5c

File tree

3 files changed

+58
-33
lines changed

3 files changed

+58
-33
lines changed

src/definitions/modules/modal.less

Lines changed: 54 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -167,29 +167,43 @@
167167
font-size: @imageIconSize;
168168
}
169169

170-
/*--------------
171-
Actions
172-
---------------*/
170+
& when (@variationModalActions) {
171+
/*--------------
172+
Actions
173+
---------------*/
173174

174-
.ui.modal > .actions {
175-
background: @actionBackground;
176-
padding: @actionPadding;
177-
border-top: @actionBorder;
178-
text-align: @actionAlign;
179-
}
180-
.ui.modal .actions > .button:not(.fluid) {
181-
margin-left: @buttonDistance;
182-
}
183-
.ui.basic.modal > .actions {
184-
border-top:none;
175+
.ui.modal > .actions {
176+
background: @actionBackground;
177+
padding: @actionPadding;
178+
border-top: @actionBorder;
179+
text-align: @actionAlign;
180+
}
181+
.ui.modal .actions > .button:not(.fluid) {
182+
margin-left: @buttonDistance;
183+
}
184+
.ui.modal > .basic.actions,
185+
.ui.basic.modal > .actions {
186+
border-top: none;
187+
}
188+
& when (@variationModalLeftActions) {
189+
.ui.modal > .left.actions {
190+
text-align: left;
191+
& > .button:not(.fluid) {
192+
margin-left: @buttonLeftDistance;
193+
margin-right: @buttonLeftDistance;
194+
}
195+
}
196+
}
185197
}
186198

187-
.ui.modal > .centered,
188-
.ui.modal > .center.aligned {
189-
text-align: center;
190-
&.actions > .button:not(.fluid) {
191-
margin-left: @buttonCenteredDistance;
192-
margin-right: @buttonCenteredDistance;
199+
& when (@variationModalCentered) {
200+
.ui.modal > .centered,
201+
.ui.modal > .center.aligned {
202+
text-align: center;
203+
&.actions > .button:not(.fluid) when (@variationModalActions){
204+
margin-left: @buttonCenteredDistance;
205+
margin-right: @buttonCenteredDistance;
206+
}
193207
}
194208
}
195209

@@ -299,14 +313,15 @@
299313
padding: @mobileDescriptionPadding !important;
300314
box-shadow: none;
301315
}
302-
303-
/* Let Buttons Stack */
304-
.ui.modal > .actions {
305-
padding: @mobileActionPadding !important;
306-
}
307-
.ui.modal .actions > .buttons,
308-
.ui.modal .actions > .button {
309-
margin-bottom: @mobileButtonDistance;
316+
& when (@variationModalActions) {
317+
/* Let Buttons Stack */
318+
.ui.modal > .actions {
319+
padding: @mobileActionPadding !important;
320+
}
321+
.ui.modal .actions > .buttons,
322+
.ui.modal .actions > .button {
323+
margin-bottom: @mobileButtonDistance;
324+
}
310325
}
311326
}
312327

@@ -329,11 +344,16 @@
329344
box-shadow: none !important;
330345
color: @basicModalColor;
331346
}
347+
.ui.modal > .basic.header,
348+
.ui.modal > .basic.actions,
332349
.ui.basic.modal > .header,
333350
.ui.basic.modal > .content,
334351
.ui.basic.modal > .actions {
335352
background-color: transparent;
336353
}
354+
.ui.modal > .basic.header {
355+
border-bottom: none;
356+
}
337357
.ui.basic.modal > .header {
338358
color: @basicModalHeaderColor;
339359
border-bottom: none;
@@ -575,11 +595,12 @@
575595
background: @invertedBackground;
576596
color: @invertedHeaderColor;
577597
}
578-
579-
.ui.inverted.modal > .actions {
580-
background: @invertedActionBackground;
581-
border-top: @invertedActionBorder;
582-
color: @invertedActionColor;
598+
& when (@variationModalActions) {
599+
.ui.inverted.modal > .actions {
600+
background: @invertedActionBackground;
601+
border-top: @invertedActionBorder;
602+
color: @invertedActionColor;
603+
}
583604
}
584605

585606
.ui.inverted.dimmer > .modal > .close {

src/themes/default/globals/variation.variables

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,9 @@
559559
@variationModalScrolling: true;
560560
@variationModalLegacy: true;
561561
@variationModalCloseInside: true;
562+
@variationModalCentered: true;
563+
@variationModalActions: true;
564+
@variationModalLeftActions: true;
562565
@variationModalSizes: @variationAllSizes;
563566

564567
/* Nag */

src/themes/default/modules/modal.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868

6969
@buttonDistance: 0.75em;
7070
@buttonCenteredDistance: 0.5em;
71+
@buttonLeftDistance: @buttonCenteredDistance;
7172

7273
/* Inner Close Position (Tablet/Mobile) */
7374
@innerCloseTop: (@headerVerticalPadding - @closeHitBoxOffset + (@lineHeight - 1em));

0 commit comments

Comments
 (0)