Skip to content

Commit 3b84d0e

Browse files
author
Keenan Payne
committed
Add ability to close modals via background
1 parent 8ff20ba commit 3b84d0e

4 files changed

Lines changed: 26 additions & 1 deletion

File tree

dist/concise.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,16 @@ ol.dropdown-content {
16411641
.modal-close:hover, .modal-close:focus {
16421642
text-decoration: none; }
16431643

1644+
.modal:target .modal-close--background {
1645+
display: block;
1646+
height: 100%;
1647+
pointer-events: all;
1648+
position: absolute;
1649+
width: 100%; }
1650+
.modal:target .modal-close--background:hover {
1651+
border-bottom: none;
1652+
text-decoration: none; }
1653+
16441654
@media (min-width: 48em) {
16451655
.modal--small .modal-container {
16461656
width: 360px; } }

dist/concise.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/addons/concise-ui/components/_modals.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,19 @@
7777
&:focus { text-decoration: none; }
7878
}
7979

80+
.modal:target .modal-close--background {
81+
display: block;
82+
height: 100%;
83+
pointer-events: all;
84+
position: absolute;
85+
width: 100%;
86+
87+
&:hover {
88+
border-bottom: none;
89+
text-decoration: none;
90+
}
91+
}
92+
8093

8194
//
8295
// Modifiers

test/test.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,8 @@ <h6>Heading 6 <small>Helper text</small></h6>
490490
<div class="spinner"></div>
491491

492492
<div id="modal" class="modal">
493+
<a href="#close" class="modal-close modal-close--background"></a>
494+
493495
<div class="modal-container">
494496
<div class="modal-header">
495497
Modal Header

0 commit comments

Comments
 (0)