From 7f8775ba16bbac33e35dea973fc30a5f1e3fb8d4 Mon Sep 17 00:00:00 2001 From: S0AndS0 Date: Thu, 19 Sep 2019 18:24:42 -0700 Subject: [PATCH] :factory: Adds feature to un-check site-nav on-click anywhere but page links New pseudo element, when combined with other CSS positioning hacks, renders behind the site navigation menu while also being attached to the label that triggers the checkbox. --- _sass/minima/_layout.scss | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/_sass/minima/_layout.scss b/_sass/minima/_layout.scss index a86045140d..003e28c36b 100644 --- a/_sass/minima/_layout.scss +++ b/_sass/minima/_layout.scss @@ -71,6 +71,31 @@ input:checked ~ .trigger { display: block; padding-bottom: 5px; + + position: fixed; + top: 50px; + right: 15px; + } + + // Following fills viewport with pseudo-element that + // on-click, trips the checkbox to un-checked state. + // Stacking list elements is handled above by + // the position fixed and stuff... + input:checked + label[for="nav-trigger"]::after { + content: ''; + background-color: lightgray; + opacity: 0.2; + filter: alpha(opacity=20); + + width: 100%; + width: 100vw; + height: 100%; + height: 100vh; + position: fixed; + top: 0px; + left: 0px; + + cursor: default; } .page-link {