diff options
author | Volpeon <git@volpeon.ink> | 2024-11-16 11:34:57 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2024-11-16 11:34:57 +0100 |
commit | 9262c000cde6610ff2be5a3f66f63a097101ef00 (patch) | |
tree | 90b4bf213afa359b1371e6485a0574f6f7f9b501 | |
parent | Tabs (diff) | |
download | iro-design-9262c000cde6610ff2be5a3f66f63a097101ef00.tar.gz iro-design-9262c000cde6610ff2be5a3f66f63a097101ef00.tar.bz2 iro-design-9262c000cde6610ff2be5a3f66f63a097101ef00.zip |
Sticky offset
-rw-r--r-- | src/_core.vars.scss | 2 | ||||
-rw-r--r-- | src/_utils.scss | 2 | ||||
-rw-r--r-- | src/layouts/_split-view.scss | 9 | ||||
-rw-r--r-- | src/layouts/_split-view.vars.scss | 2 | ||||
-rw-r--r-- | src/objects/_action-button.scss | 34 |
5 files changed, 41 insertions, 8 deletions
diff --git a/src/_core.vars.scss b/src/_core.vars.scss index 53c7067..5ea8326 100644 --- a/src/_core.vars.scss +++ b/src/_core.vars.scss | |||
@@ -102,6 +102,8 @@ $key-focus--border-offset: props.def(--key-focus--border-offset, props.get($bord | |||
102 | $list--indent: props.def(--list--indent, props.get($size--400)) !default; | 102 | $list--indent: props.def(--list--indent, props.get($size--400)) !default; |
103 | $list--compact-indent: props.def(--list--compact-indent, props.get($size--250)) !default; | 103 | $list--compact-indent: props.def(--list--compact-indent, props.get($size--250)) !default; |
104 | 104 | ||
105 | $sticky-top-offset: props.def(--sticky-top-offset, 0) !default; | ||
106 | |||
105 | // | 107 | // |
106 | 108 | ||
107 | $-static-colors: (); | 109 | $-static-colors: (); |
diff --git a/src/_utils.scss b/src/_utils.scss index 598eae4..6e7faf7 100644 --- a/src/_utils.scss +++ b/src/_utils.scss | |||
@@ -214,7 +214,7 @@ $-sizes: ( | |||
214 | 214 | ||
215 | @include bem.utility('p-sticky-bs') { | 215 | @include bem.utility('p-sticky-bs') { |
216 | position: sticky; | 216 | position: sticky; |
217 | inset-block-start: 0; | 217 | inset-block-start: props.get(vars.$sticky-top-offset); |
218 | } | 218 | } |
219 | 219 | ||
220 | @include bem.utility('p-sticky-be') { | 220 | @include bem.utility('p-sticky-be') { |
diff --git a/src/layouts/_split-view.scss b/src/layouts/_split-view.scss index a76f6e8..2744510 100644 --- a/src/layouts/_split-view.scss +++ b/src/layouts/_split-view.scss | |||
@@ -30,14 +30,19 @@ | |||
30 | min-inline-size: props.get(vars.$panel--side-25--min); | 30 | min-inline-size: props.get(vars.$panel--side-25--min); |
31 | } | 31 | } |
32 | 32 | ||
33 | @include bem.modifier('sticky') { | 33 | @include bem.modifier('sticky-0') { |
34 | position: sticky; | 34 | position: sticky; |
35 | inset-block-start: 0; | 35 | inset-block-start: 0; |
36 | } | 36 | } |
37 | 37 | ||
38 | @include bem.modifier('sticky') { | ||
39 | position: sticky; | ||
40 | inset-block-start: props.get(vars.$panel--sticky-offset); | ||
41 | } | ||
42 | |||
38 | @include bem.modifier('sticky-400') { | 43 | @include bem.modifier('sticky-400') { |
39 | position: sticky; | 44 | position: sticky; |
40 | inset-block-start: props.get(vars.$panel--sticky-400--inset); | 45 | inset-block-start: calc(props.get(vars.$panel--sticky-400--inset) + props.get(vars.$panel--sticky-offset)); |
41 | } | 46 | } |
42 | } | 47 | } |
43 | 48 | ||
diff --git a/src/layouts/_split-view.vars.scss b/src/layouts/_split-view.vars.scss index 8f6bf93..01562e1 100644 --- a/src/layouts/_split-view.vars.scss +++ b/src/layouts/_split-view.vars.scss | |||
@@ -8,3 +8,5 @@ $gapless: props.def(--l-split-view--gapless, 0) !default; | |||
8 | 8 | ||
9 | $panel--side-25--min: props.def(--l-split-view--panel--side-25--min, props.get(core.$size--3200)) !default; | 9 | $panel--side-25--min: props.def(--l-split-view--panel--side-25--min, props.get(core.$size--3200)) !default; |
10 | $panel--sticky-400--inset: props.def(--l-split-view--panel--sticky-400--inset, props.get(core.$size--400)) !default; | 10 | $panel--sticky-400--inset: props.def(--l-split-view--panel--sticky-400--inset, props.get(core.$size--400)) !default; |
11 | |||
12 | $panel--sticky-offset: props.def(--l-split-view--panel--sticky-offset, props.get(core.$sticky-top-offset)) !default; | ||
diff --git a/src/objects/_action-button.scss b/src/objects/_action-button.scss index dcabb57..206c611 100644 --- a/src/objects/_action-button.scss +++ b/src/objects/_action-button.scss | |||
@@ -158,6 +158,11 @@ | |||
158 | } | 158 | } |
159 | } | 159 | } |
160 | 160 | ||
161 | @include bem.modifier('icon') { | ||
162 | inline-size: calc(1em * props.get(vars.$line-height) + 2 * props.get(vars.$pad-b)); | ||
163 | padding-inline: 0; | ||
164 | } | ||
165 | |||
161 | @each $mod, $pad-i, $pad-i-label, $pad-i-pill, $pad-b, $font-size in vars.$fixed-sizes { | 166 | @each $mod, $pad-i, $pad-i-label, $pad-i-pill, $pad-b, $font-size in vars.$fixed-sizes { |
162 | @include bem.modifier($mod) { | 167 | @include bem.modifier($mod) { |
163 | padding-block: props.get($pad-b); | 168 | padding-block: props.get($pad-b); |
@@ -171,17 +176,36 @@ | |||
171 | @include bem.modifier('pill') { | 176 | @include bem.modifier('pill') { |
172 | padding-inline: props.get($pad-i-pill); | 177 | padding-inline: props.get($pad-i-pill); |
173 | } | 178 | } |
179 | |||
180 | @include bem.modifier('icon') { | ||
181 | inline-size: calc(1em * props.get(vars.$line-height) + 2 * props.get($pad-b)); | ||
182 | padding-inline: 0; | ||
183 | } | ||
174 | } | 184 | } |
175 | } | 185 | } |
176 | 186 | ||
177 | @include bem.modifier('icon') { | 187 | @include bem.modifier('align-inline') { |
178 | inline-size: calc(1em * props.get(vars.$line-height) + 2 * props.get(vars.$pad-b)); | 188 | margin-inline: calc(-1 * props.get(vars.$pad-i)); |
179 | padding-inline: 0; | 189 | |
190 | @include bem.modifier('pill') { | ||
191 | margin-inline: calc(-1 * props.get(vars.$pad-i-pill)); | ||
192 | } | ||
193 | |||
194 | @include bem.modifier('icon') { | ||
195 | margin-inline: calc(-1 * props.get(vars.$pad-b) - .5em * props.get(vars.$line-height)); | ||
196 | } | ||
180 | 197 | ||
181 | @each $mod, $pad-i, $pad-i-label, $pad-i-pill, $pad-b, $font-size in vars.$fixed-sizes { | 198 | @each $mod, $pad-i, $pad-i-label, $pad-i-pill, $pad-b, $font-size in vars.$fixed-sizes { |
182 | @include bem.modifier($mod) { | 199 | @include bem.modifier($mod) { |
183 | inline-size: calc(1em * props.get(vars.$line-height) + 2 * props.get($pad-b)); | 200 | margin-inline: calc(-1 * props.get($pad-i)); |
184 | padding-inline: 0; | 201 | |
202 | @include bem.modifier('pill') { | ||
203 | margin-inline: calc(-1 * props.get($pad-i-pill)); | ||
204 | } | ||
205 | |||
206 | @include bem.modifier('icon') { | ||
207 | margin-inline: calc(-1 * props.get($pad-b) - .5em * props.get(vars.$line-height)); | ||
208 | } | ||
185 | } | 209 | } |
186 | } | 210 | } |
187 | } | 211 | } |