Skip to content

Commit

Permalink
feat(modal): allow close icon to be inside header for small modals
Browse files Browse the repository at this point in the history
On larger screens an existing close icon of a modal is always displayed outside of the modal itself.
Only when using fullscreen it is put directly into the header by default.

To make this behavior possible for small modals on large screens as well i invented an optional class inside which can be added to the close icon
  • Loading branch information
lubber-de authored and Sean committed Dec 22, 2019
1 parent e090062 commit de0e2b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/definitions/modules/modal.less
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@
}
}

& when (@variationModalFullscreen) or (@variationModalOverlay) {
& when (@variationModalFullscreen) or (@variationModalOverlay) or (@variationModalCloseInside) {
/*--------------
Full Screen
---------------*/
Expand All @@ -461,9 +461,11 @@
border-radius:0;
}
}
.ui.modal > .close.inside + .header,
.ui.fullscreen.modal > .header {
padding-right: @closeHitbox;
}
.ui.modal > .close.inside,
.ui.fullscreen.modal > .close {
top: @innerCloseTop;
right: @innerCloseRight;
Expand Down Expand Up @@ -562,7 +564,8 @@
color: @invertedCloseColor;
}
}
& when (@variationModalFullscreen) {
& when (@variationModalFullscreen) or (@variationModalCloseInside) {
.ui.inverted.modal > .close.inside,
.ui.inverted.fullscreen.modal > .close {
color: @invertedCloseColor;
}
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/globals/variation.variables
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@
@variationModalAligned: true;
@variationModalScrolling: true;
@variationModalLegacy: true;
@variationModalCloseInside: true;
@variationModalSizes: @variationAllSizes;

/* Popup */
Expand Down

0 comments on commit de0e2b8

Please sign in to comment.