diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-20 15:18:49 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-20 15:23:27 +0100 |
| commit | f7b08ee862e62b9f8764303f1fef733f210a7138 (patch) | |
| tree | 1273bc8d85a5d3205310f5a26005cc79d1dc3a50 /src/components/MainNav | |
| parent | fa6adedc42e9c6ec39cc30df16b54900c220b094 (diff) | |
chore: add a toolbar component
Diffstat (limited to 'src/components/MainNav')
| -rw-r--r-- | src/components/MainNav/MainNav.module.scss | 26 | ||||
| -rw-r--r-- | src/components/MainNav/MainNav.tsx | 1 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/components/MainNav/MainNav.module.scss b/src/components/MainNav/MainNav.module.scss index cc4b45b..596f1d5 100644 --- a/src/components/MainNav/MainNav.module.scss +++ b/src/components/MainNav/MainNav.module.scss @@ -3,8 +3,6 @@ @use "@styles/abstracts/placeholders"; .wrapper { - --btn-size: #{fun.convert-px(50)}; - display: flex; flex-flow: column nowrap; place-items: center; @@ -12,7 +10,6 @@ width: var(--btn-size); background: var(--color-bg); position: relative; - z-index: 5; @include mix.media("screen") { @include mix.dimensions("sm") { @@ -41,6 +38,8 @@ .checkbox { position: absolute; + + // centered checkbox = btn-size - approximated checkbox size / 2 top: calc((var(--btn-size) - #{fun.convert-px(14)}) / 2); left: calc((var(--btn-size) - #{fun.convert-px(14)}) / 2); opacity: 0; @@ -55,14 +54,12 @@ .nav { display: flex; - flex-flow: column nowrap; + flex-flow: column wrap; place-content: center; padding-bottom: var(--toolbar-size); - position: absolute; - bottom: auto; - left: auto; - right: auto; - top: var(--btn-size); + position: fixed; + bottom: 0; + z-index: -1; background: var(--color-bg-opacity); box-shadow: 0 0 3px 0 var(--color-shadow); text-align: center; @@ -73,6 +70,13 @@ @include mix.media("screen") { @include mix.dimensions("sm") { + padding-bottom: 0; + position: absolute; + bottom: auto; + left: auto; + right: auto; + top: var(--btn-size); + z-index: unset; border-bottom-width: fun.convert-px(5); transform-origin: 50% -100%; } @@ -109,6 +113,10 @@ text-decoration: none; @include mix.media("screen") { + @include mix.dimensions(null, "2xs", "height") { + padding: var(--spacing-2xs) var(--spacing-sm) 0; + } + @include mix.dimensions("md") { background: inherit; } diff --git a/src/components/MainNav/MainNav.tsx b/src/components/MainNav/MainNav.tsx index 3140e64..2440980 100644 --- a/src/components/MainNav/MainNav.tsx +++ b/src/components/MainNav/MainNav.tsx @@ -50,6 +50,7 @@ const MainNav = () => { className={styles.checkbox} checked={isChecked} onChange={() => setIsChecked(!isChecked)} + autoComplete="off" /> <label htmlFor="main-nav__checkbox" |
