aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/overlay/overlay.module.scss
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-31 17:41:43 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:15:27 +0100
commit2844a2bd71dcf1eb17a53992c10129b7496332e0 (patch)
tree6b59044ade226c7dad7d1e64c9586e8d6ff0374b /src/components/atoms/overlay/overlay.module.scss
parent3ff4c37a7a2c40340c17f9e6c1754444bce0f839 (diff)
feat(components): add an Overlay component
* add useScrollbarWidth hook * add useScrollLock hook * add a new component to lock scroll with an overlay (it can be useful especially on small screens to prevent background contents to be scrolled)
Diffstat (limited to 'src/components/atoms/overlay/overlay.module.scss')
-rw-r--r--src/components/atoms/overlay/overlay.module.scss18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/components/atoms/overlay/overlay.module.scss b/src/components/atoms/overlay/overlay.module.scss
new file mode 100644
index 0000000..edbc4ae
--- /dev/null
+++ b/src/components/atoms/overlay/overlay.module.scss
@@ -0,0 +1,18 @@
+.overlay {
+ position: fixed;
+ inset: 0;
+ z-index: 100;
+ background: hsla(0, 0%, 0%, 0.6);
+ transition: all 0.3s linear 0s;
+
+ &--hidden {
+ opacity: 0;
+ overflow: hidden;
+ visibility: hidden;
+ }
+
+ &--visible {
+ opacity: 1;
+ visibility: visible;
+ }
+}