diff options
author | Volpeon <git@volpeon.ink> | 2022-02-06 10:28:10 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2022-02-06 10:28:10 +0100 |
commit | ea8b0bc19219f6f931e3be757c25743c2c828b2e (patch) | |
tree | 056af48e13f84e76cb9a26b8b76d28a4fe48d404 /tpl/objects | |
parent | Added radio (diff) | |
download | iro-design-ea8b0bc19219f6f931e3be757c25743c2c828b2e.tar.gz iro-design-ea8b0bc19219f6f931e3be757c25743c2c828b2e.tar.bz2 iro-design-ea8b0bc19219f6f931e3be757c25743c2c828b2e.zip |
Added checkbox and switch
Diffstat (limited to 'tpl/objects')
-rw-r--r-- | tpl/objects/checkbox.pug | 18 | ||||
-rw-r--r-- | tpl/objects/icon.pug | 6 | ||||
-rw-r--r-- | tpl/objects/radio.pug | 8 | ||||
-rw-r--r-- | tpl/objects/switch.pug | 12 |
4 files changed, 40 insertions, 4 deletions
diff --git a/tpl/objects/checkbox.pug b/tpl/objects/checkbox.pug new file mode 100644 index 0000000..874505b --- /dev/null +++ b/tpl/objects/checkbox.pug | |||
@@ -0,0 +1,18 @@ | |||
1 | include icon.pug | ||
2 | |||
3 | mixin checkbox | ||
4 | - | ||
5 | let classes = { | ||
6 | 'o-checkbox': true, | ||
7 | 'o-checkbox--accent': attributes.accent, | ||
8 | } | ||
9 | |||
10 | label(class=classes) | ||
11 | input.o-checkbox__native( | ||
12 | type='checkbox' | ||
13 | class={ 'is-indeterminate': attributes.indeterminate } | ||
14 | )&attributes(attributes) | ||
15 | .o-checkbox__box | ||
16 | +icon('check')(class='o-checkbox__check-icon') | ||
17 | .o-checkbox__label | ||
18 | block | ||
diff --git a/tpl/objects/icon.pug b/tpl/objects/icon.pug index a77a3ed..0e444f9 100644 --- a/tpl/objects/icon.pug +++ b/tpl/objects/icon.pug | |||
@@ -1,7 +1,7 @@ | |||
1 | mixin icon(id) | 1 | mixin icon(id) |
2 | - | 2 | - |
3 | let href = '../node_modules/iro-icons/src/icons/' + id + '.svg' | 3 | let href = 'icons.svg#' + id |
4 | let classes = attributes.class ? attributes.class : '' | 4 | let classes = attributes.class ? attributes.class : '' |
5 | 5 | ||
6 | svg(class=['o-icon', 'o-icon--iro', 'o-icon--iro-' + id, classes] width='1em' height='1em') | 6 | svg(class=['o-icon', classes] width='1em' height='1em') |
7 | use(xlink:href=href) | 7 | use(href=href) |
diff --git a/tpl/objects/radio.pug b/tpl/objects/radio.pug index da6a026..8cb1b1f 100644 --- a/tpl/objects/radio.pug +++ b/tpl/objects/radio.pug | |||
@@ -1,5 +1,11 @@ | |||
1 | mixin radio | 1 | mixin radio |
2 | label.o-radio | 2 | - |
3 | let classes = { | ||
4 | 'o-radio': true, | ||
5 | 'o-radio--accent': attributes.accent, | ||
6 | } | ||
7 | |||
8 | label(class=classes) | ||
3 | input.o-radio__native(type='radio')&attributes(attributes) | 9 | input.o-radio__native(type='radio')&attributes(attributes) |
4 | .o-radio__circle | 10 | .o-radio__circle |
5 | .o-radio__label | 11 | .o-radio__label |
diff --git a/tpl/objects/switch.pug b/tpl/objects/switch.pug new file mode 100644 index 0000000..0c9c1ab --- /dev/null +++ b/tpl/objects/switch.pug | |||
@@ -0,0 +1,12 @@ | |||
1 | mixin switch | ||
2 | - | ||
3 | let classes = { | ||
4 | 'o-switch': true, | ||
5 | 'o-switch--accent': attributes.accent, | ||
6 | } | ||
7 | |||
8 | label(class=classes) | ||
9 | input.o-switch__native(type='checkbox')&attributes(attributes) | ||
10 | .o-switch__indicator | ||
11 | .o-switch__label | ||
12 | block | ||