summaryrefslogtreecommitdiffstats
path: root/src/objects
diff options
context:
space:
mode:
authorVolpeon <git@volpeon.ink>2022-03-31 09:51:12 +0200
committerVolpeon <git@volpeon.ink>2022-03-31 09:51:12 +0200
commit9e5f08e31b4d228da011fa7cd92240433116997f (patch)
treea36e7f0a4ec407924260da24d86446235387941e /src/objects
parentRemove t-lo (diff)
downloadiro-design-9e5f08e31b4d228da011fa7cd92240433116997f.tar.gz
iro-design-9e5f08e31b4d228da011fa7cd92240433116997f.tar.bz2
iro-design-9e5f08e31b4d228da011fa7cd92240433116997f.zip
Added icon nav component
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/_action-button.scss38
-rw-r--r--src/objects/_icon-nav.scss68
-rw-r--r--src/objects/_menu.scss16
3 files changed, 107 insertions, 15 deletions
diff --git a/src/objects/_action-button.scss b/src/objects/_action-button.scss
index 2dcbb12..1cce94f 100644
--- a/src/objects/_action-button.scss
+++ b/src/objects/_action-button.scss
@@ -103,6 +103,13 @@
103 background-color: fn.color(--active --bg); 103 background-color: fn.color(--active --bg);
104 color: fn.color(--active --label); 104 color: fn.color(--active --label);
105 } 105 }
106
107 @include iro.bem-at-theme('keyboard') {
108 &:focus {
109 background-color: fn.color(--hover --bg);
110 color: fn.color(--hover --label);
111 }
112 }
106 } 113 }
107 114
108 @include iro.bem-is('selected') { 115 @include iro.bem-is('selected') {
@@ -119,6 +126,13 @@
119 background-color: fn.color(--selected --bg); 126 background-color: fn.color(--selected --bg);
120 color: fn.color(--selected --hover --label); 127 color: fn.color(--selected --hover --label);
121 } 128 }
129
130 @include iro.bem-at-theme('keyboard') {
131 &:focus {
132 background-color: fn.color(--selected --bg);
133 color: fn.color(--selected --hover --label);
134 }
135 }
122 } 136 }
123 } 137 }
124 138
@@ -149,6 +163,13 @@
149 box-shadow: none; 163 box-shadow: none;
150 color: fn.color(--quiet --active --label); 164 color: fn.color(--quiet --active --label);
151 } 165 }
166
167 @include iro.bem-at-theme('keyboard') {
168 &:focus {
169 background-color: fn.color(--quiet --hover --bg);
170 color: fn.color(--quiet --hover --label);
171 }
172 }
152 } 173 }
153 174
154 @include iro.bem-is('selected') { 175 @include iro.bem-is('selected') {
@@ -170,18 +191,21 @@
170 box-shadow: none; 191 box-shadow: none;
171 color: fn.color(--quiet --selected --hover --label); 192 color: fn.color(--quiet --selected --hover --label);
172 } 193 }
194
195 @include iro.bem-at-theme('keyboard') {
196 &:focus {
197 background-color: fn.color(--quiet --selected --bg);
198 color: fn.color(--quiet --selected --hover --label);
199 }
200 }
173 } 201 }
174 } 202 }
175 } 203 }
176 204
177 @include iro.bem-at-theme('keyboard') { 205 @include iro.bem-at-theme('keyboard') {
178 &:link, 206 &:focus {
179 &:visited, 207 border-color: fn.color(--key-focus --border);
180 &:enabled { 208 box-shadow: inset 0 0 0 1px fn.color(--key-focus --border), fn.color(--key-focus --shadow);
181 &:focus {
182 border-color: fn.color(--key-focus --border);
183 box-shadow: inset 0 0 0 1px fn.color(--key-focus --border), fn.color(--key-focus --shadow);
184 }
185 } 209 }
186 } 210 }
187 211
diff --git a/src/objects/_icon-nav.scss b/src/objects/_icon-nav.scss
new file mode 100644
index 0000000..25f4a57
--- /dev/null
+++ b/src/objects/_icon-nav.scss
@@ -0,0 +1,68 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3
4@include iro.props-namespace('icon-nav') {
5 @include iro.props-store((
6 --dims: (
7 --spacing: fn.global-dim(--size --100),
8 --item: (
9 --pad: fn.global-dim(--size --125),
10 )
11 )
12 ), 'dims');
13
14 @include iro.props-store((
15 --colors: (
16 --item: (
17 --hover: (
18 --bg: fn.global-color(--obj-hi),
19 --label: fn.global-color(--fg-lo),
20 ),
21 --disabled: (
22 --label: fn.global-color(--fg-hi3),
23 ),
24 --key-focus: (
25 --border: fn.global-color(--focus --fill),
26 --shadow: fn.global-color(--focus --shadow),
27 ),
28 ),
29 ),
30 ), 'colors');
31
32 @include iro.bem-object(iro.props-namespace()) {
33 display: flex;
34 align-items: center;
35 gap: fn.dim(--spacing);
36
37 @include iro.bem-elem('item') {
38 padding: fn.dim(--item --pad);
39 border: 2px solid transparent;
40 border-radius: 10em;
41 color: fn.color(--item --disabled --label);
42
43 &:link,
44 &:visited,
45 &:enabled {
46 color: currentColor;
47
48 @include iro.bem-multi('&:hover, &:active', 'is' 'selected') {
49 background-color: fn.color(--item --hover --bg);
50 color: fn.color(--item --hover --label);
51 }
52
53 @include iro.bem-at-theme('keyboard') {
54 &:focus {
55 border-color: fn.color(--item --key-focus --border);
56 background-color: fn.color(--item --hover --bg);
57 box-shadow: fn.color(--item --key-focus --shadow);
58 color: fn.color(--item --hover --label);
59 }
60 }
61 }
62 }
63
64 @include iro.bem-modifier('vertical') {
65 flex-direction: column;
66 }
67 }
68}
diff --git a/src/objects/_menu.scss b/src/objects/_menu.scss
index f732ab7..fae3207 100644
--- a/src/objects/_menu.scss
+++ b/src/objects/_menu.scss
@@ -4,6 +4,7 @@
4@include iro.props-namespace('menu') { 4@include iro.props-namespace('menu') {
5 @include iro.props-store(( 5 @include iro.props-store((
6 --dims: ( 6 --dims: (
7 --spacing: fn.global-dim(--size --25),
7 --header: ( 8 --header: (
8 --font-size: fn.global-dim(--font-size --50), 9 --font-size: fn.global-dim(--font-size --50),
9 ), 10 ),
@@ -30,8 +31,6 @@
30 --label: fn.global-color(--fg-hi3), 31 --label: fn.global-color(--fg-hi3),
31 ), 32 ),
32 --key-focus: ( 33 --key-focus: (
33 --bg: fn.global-color(--obj-hi),
34 --label: fn.global-color(--fg-lo),
35 --border: fn.global-color(--focus --fill), 34 --border: fn.global-color(--focus --fill),
36 --shadow: fn.global-color(--focus --shadow), 35 --shadow: fn.global-color(--focus --shadow),
37 ), 36 ),
@@ -40,6 +39,10 @@
40 ), 'colors'); 39 ), 'colors');
41 40
42 @include iro.bem-object(iro.props-namespace()) { 41 @include iro.bem-object(iro.props-namespace()) {
42 display: flex;
43 flex-direction: column;
44 gap: fn.dim(--spacing);
45
43 @include iro.bem-elem('header') { 46 @include iro.bem-elem('header') {
44 padding: fn.dim(--item --pad-y) fn.dim(--item --pad-x); 47 padding: fn.dim(--item --pad-y) fn.dim(--item --pad-x);
45 color: fn.color(--header --label); 48 color: fn.color(--header --label);
@@ -50,9 +53,6 @@
50 } 53 }
51 54
52 @include iro.bem-elem('item') { 55 @include iro.bem-elem('item') {
53 display: block;
54 box-sizing: border-box;
55 width: 100%;
56 padding: calc(fn.dim(--item --pad-y) - 2px) calc(fn.dim(--item --pad-x) - 2px); 56 padding: calc(fn.dim(--item --pad-y) - 2px) calc(fn.dim(--item --pad-x) - 2px);
57 border: 2px solid transparent; 57 border: 2px solid transparent;
58 border-radius: fn.dim(--item --rounding); 58 border-radius: fn.dim(--item --rounding);
@@ -70,11 +70,11 @@
70 70
71 @include iro.bem-at-theme('keyboard') { 71 @include iro.bem-at-theme('keyboard') {
72 &:focus { 72 &:focus {
73 border-radius: 2px; 73 border-radius: calc(fn.dim(--item --rounding) - 1px);
74 border-color: fn.color(--item --key-focus --border); 74 border-color: fn.color(--item --key-focus --border);
75 background-color: fn.color(--item --key-focus --bg); 75 background-color: fn.color(--item --hover --bg);
76 box-shadow: fn.color(--item --key-focus --shadow); 76 box-shadow: fn.color(--item --key-focus --shadow);
77 color: fn.color(--item --key-focus --label); 77 color: fn.color(--item --hover --label);
78 } 78 }
79 } 79 }
80 } 80 }