webcoreui 0.0.12 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -6
- package/astro.d.ts +4 -0
- package/astro.js +4 -0
- package/components/Accordion/accordion.module.scss +20 -27
- package/components/Alert/alert.module.scss +19 -22
- package/components/Avatar/avatar.module.scss +9 -6
- package/components/Badge/badge.module.scss +31 -34
- package/components/Button/Button.astro +0 -2
- package/components/Button/Button.svelte +0 -2
- package/components/Button/Button.tsx +0 -2
- package/components/Button/button.module.scss +32 -39
- package/components/Button/button.ts +1 -2
- package/components/Card/card.module.scss +19 -15
- package/components/Checkbox/checkbox.module.scss +27 -41
- package/components/Icon/Icon.astro +2 -2
- package/components/Icon/map.ts +2 -0
- package/components/Input/input.module.scss +28 -36
- package/components/Menu/Menu.astro +7 -3
- package/components/Menu/Menu.svelte +11 -3
- package/components/Menu/Menu.tsx +7 -1
- package/components/Menu/menu.module.scss +144 -144
- package/components/Menu/menu.ts +1 -0
- package/components/Modal/Modal.astro +70 -0
- package/components/Modal/Modal.svelte +71 -0
- package/components/Modal/Modal.tsx +76 -0
- package/components/Modal/modal.module.scss +103 -0
- package/components/Modal/modal.ts +18 -0
- package/components/Progress/progress.module.scss +26 -22
- package/components/Radio/radio.module.scss +32 -41
- package/components/Rating/Rating.astro +2 -2
- package/components/Rating/Rating.svelte +2 -2
- package/components/Rating/Rating.tsx +2 -2
- package/components/Rating/rating.module.scss +15 -8
- package/components/Slider/Slider.astro +44 -0
- package/components/Slider/Slider.svelte +42 -0
- package/components/Slider/Slider.tsx +48 -0
- package/components/Slider/slider.module.scss +68 -0
- package/components/Slider/slider.ts +20 -0
- package/components/Spinner/spinner.module.scss +11 -2
- package/components/Switch/switch.module.scss +28 -30
- package/components/Table/Table.astro +6 -1
- package/components/Table/Table.svelte +3 -1
- package/components/Table/Table.tsx +7 -1
- package/components/Table/table.module.scss +23 -17
- package/components/Table/table.ts +1 -0
- package/components/Tabs/Tabs.astro +0 -1
- package/components/Tabs/tabs.module.scss +45 -48
- package/components/ThemeSwitcher/ThemeSwitcher.astro +1 -0
- package/components/ThemeSwitcher/ThemeSwitcher.svelte +2 -1
- package/components/ThemeSwitcher/ThemeSwitcher.tsx +2 -1
- package/components/ThemeSwitcher/themeswitcher.module.scss +28 -26
- package/components/Timeline/timeline.module.scss +28 -23
- package/components/TimelineItem/TimelineItem.tsx +1 -6
- package/components/TimelineItem/timelineitem.module.scss +14 -17
- package/components/TimelineItem/timelineitem.ts +5 -0
- package/components/Toast/toast.module.scss +10 -14
- package/components/Toast/toast.ts +6 -1
- package/icons/close.svg +3 -0
- package/icons.d.ts +12 -0
- package/icons.js +10 -0
- package/index.js +2 -0
- package/package.json +3 -1
- package/react.d.ts +6 -2
- package/react.js +4 -0
- package/scss/config/color-palette.scss +24 -0
- package/scss/config/css-values.scss +44 -0
- package/scss/config/layout.scss +41 -0
- package/scss/config/mixins.scss +392 -9
- package/scss/config/typography.scss +65 -0
- package/scss/config.scss +6 -1
- package/scss/global/elements.scss +21 -1
- package/scss/global/scrollbar.scss +12 -9
- package/scss/global/theme.scss +73 -40
- package/scss/global/tooltip.scss +42 -35
- package/scss/global/utility.scss +79 -61
- package/scss/global.scss +0 -1
- package/scss/resets.scss +67 -9
- package/scss/setup.scss +14 -41
- package/svelte.d.ts +4 -0
- package/svelte.js +4 -0
- package/utils/interpolate.ts +23 -0
- package/utils/modal.ts +59 -0
- package/utils/toast.ts +3 -2
package/icons/close.svg
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.390524 0.390524C0.911223 -0.130175 1.75544 -0.130175 2.27614 0.390524L12 10.1144L21.7239 0.390524C22.2446 -0.130175 23.0888 -0.130175 23.6095 0.390524C24.1302 0.911223 24.1302 1.75544 23.6095 2.27614L13.8856 12L23.6095 21.7239C24.1302 22.2446 24.1302 23.0888 23.6095 23.6095C23.0888 24.1302 22.2446 24.1302 21.7239 23.6095L12 13.8856L2.27614 23.6095C1.75544 24.1302 0.911223 24.1302 0.390524 23.6095C-0.130175 23.0888 -0.130175 22.2446 0.390524 21.7239L10.1144 12L0.390524 2.27614C-0.130175 1.75544 -0.130175 0.911223 0.390524 0.390524Z" fill="currentColor"/>
|
|
3
|
+
</svg>
|
package/icons.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare module 'webcoreui/icons' {
|
|
2
|
+
export const alert: string
|
|
3
|
+
export const arrowDown: string
|
|
4
|
+
export const check: string
|
|
5
|
+
export const circleCheck: string
|
|
6
|
+
export const close: string
|
|
7
|
+
export const github: string
|
|
8
|
+
export const info: string
|
|
9
|
+
export const moon: string
|
|
10
|
+
export const sun: string
|
|
11
|
+
export const warning: string
|
|
12
|
+
}
|
package/icons.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as alert } from './icons/alert.svg?raw'
|
|
2
|
+
export { default as arrowDown } from './icons/arrow-down.svg?raw'
|
|
3
|
+
export { default as check } from './icons/check.svg?raw'
|
|
4
|
+
export { default as circleCheck } from './icons/circle-check.svg?raw'
|
|
5
|
+
export { default as close } from './icons/close.svg?raw'
|
|
6
|
+
export { default as github } from './icons/github.svg?raw'
|
|
7
|
+
export { default as info } from './icons/info.svg?raw'
|
|
8
|
+
export { default as moon } from './icons/moon.svg?raw'
|
|
9
|
+
export { default as sun } from './icons/sun.svg?raw'
|
|
10
|
+
export { default as warning } from './icons/warning.svg?raw'
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webcoreui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "astro dev",
|
|
7
7
|
"build": "astro check && astro build",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"utils",
|
|
37
37
|
"astro.d.ts",
|
|
38
38
|
"astro.js",
|
|
39
|
+
"icons.d.ts",
|
|
40
|
+
"icons.js",
|
|
39
41
|
"svelte.d.ts",
|
|
40
42
|
"svelte.js",
|
|
41
43
|
"react.d.ts",
|
package/react.d.ts
CHANGED
|
@@ -10,16 +10,18 @@ import type { ReactConditionalWrapperProps } from './components/ConditionalWrapp
|
|
|
10
10
|
import type { IconProps } from './components/Icon/icon'
|
|
11
11
|
import type { ReactInputProps } from './components/Input/input'
|
|
12
12
|
import type { ReactMenuProps } from './components/Menu/menu'
|
|
13
|
+
import type { ReactModalProps } from './components/Modal/modal'
|
|
13
14
|
import type { ProgressProps } from './components/Progress/progress'
|
|
14
15
|
import type { ReactRadioProps } from './components/Radio/radio'
|
|
15
16
|
import type { RatingProps } from './components/Rating/rating'
|
|
17
|
+
import type { ReactSliderProps } from './components/Slider/slider'
|
|
16
18
|
import type { SpinnerProps } from './components/Spinner/spinner'
|
|
17
19
|
import type { ReactSwitchProps } from './components/Switch/switch'
|
|
18
20
|
import type { TableProps } from './components/Table/table'
|
|
19
21
|
import type { ReactTabsProps } from './components/Tabs/tabs'
|
|
20
22
|
import type { ReactThemeSwitcherProps } from './components/ThemeSwitcher/themeswitcher'
|
|
21
23
|
import type { ReactTimelineProps } from './components/Timeline/timeline'
|
|
22
|
-
import type {
|
|
24
|
+
import type { ReactTimelineItemProps } from './components/TimelineItem/timelineitem'
|
|
23
25
|
import type { ReactToastProps } from './components/Toast/toast'
|
|
24
26
|
|
|
25
27
|
declare module 'webcoreui/react' {
|
|
@@ -34,15 +36,17 @@ declare module 'webcoreui/react' {
|
|
|
34
36
|
export const Icon: FC<IconProps>
|
|
35
37
|
export const Input: FC<ReactInputProps>
|
|
36
38
|
export const Menu: FC<ReactMenuProps>
|
|
39
|
+
export const Modal: FC<ReactModalProps>
|
|
37
40
|
export const Progress: FC<ProgressProps>
|
|
38
41
|
export const Radio: FC<ReactRadioProps>
|
|
39
42
|
export const Rating: FC<RatingProps>
|
|
43
|
+
export const Slider: FC<ReactSliderProps>
|
|
40
44
|
export const Spinner: FC<SpinnerProps>
|
|
41
45
|
export const Switch: FC<ReactSwitchProps>
|
|
42
46
|
export const Table: FC<TableProps>
|
|
43
47
|
export const Tabs: FC<ReactTabsProps>
|
|
44
48
|
export const ThemeSwitcher: FC<ReactThemeSwitcherProps>
|
|
45
49
|
export const Timeline: FC<ReactTimelineProps>
|
|
46
|
-
export const TimelineItem: FC<
|
|
50
|
+
export const TimelineItem: FC<ReactTimelineItemProps>
|
|
47
51
|
export const Toast: FC<ReactToastProps>
|
|
48
52
|
}
|
package/react.js
CHANGED
|
@@ -9,9 +9,11 @@ import ConditionalWrapperComponent from './components/ConditionalWrapper/Conditi
|
|
|
9
9
|
import IconComponent from './components/Icon/Icon.tsx'
|
|
10
10
|
import InputComponent from './components/Input/Input.tsx'
|
|
11
11
|
import MenuComponent from './components/Menu/Menu.tsx'
|
|
12
|
+
import ModalComponent from './components/Modal/Modal.tsx'
|
|
12
13
|
import ProgressComponent from './components/Progress/Progress.tsx'
|
|
13
14
|
import RadioComponent from './components/Radio/Radio.tsx'
|
|
14
15
|
import RatingComponent from './components/Rating/Rating.tsx'
|
|
16
|
+
import SliderComponent from './components/Slider/Slider.tsx'
|
|
15
17
|
import SpinnerComponent from './components/Spinner/Spinner.tsx'
|
|
16
18
|
import SwitchComponent from './components/Switch/Switch.tsx'
|
|
17
19
|
import TableComponent from './components/Table/Table.tsx'
|
|
@@ -32,9 +34,11 @@ export const ConditionalWrapper = ConditionalWrapperComponent
|
|
|
32
34
|
export const Icon = IconComponent
|
|
33
35
|
export const Input = InputComponent
|
|
34
36
|
export const Menu = MenuComponent
|
|
37
|
+
export const Modal = ModalComponent
|
|
35
38
|
export const Progress = ProgressComponent
|
|
36
39
|
export const Radio = RadioComponent
|
|
37
40
|
export const Rating = RatingComponent
|
|
41
|
+
export const Slider = SliderComponent
|
|
38
42
|
export const Spinner = SpinnerComponent
|
|
39
43
|
export const Switch = SwitchComponent
|
|
40
44
|
export const Table = TableComponent
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
$colorPalette: (
|
|
2
|
+
'primary': var(--w-color-primary),
|
|
3
|
+
'primary-10': var(--w-color-primary-10),
|
|
4
|
+
'primary-20': var(--w-color-primary-20),
|
|
5
|
+
'primary-30': var(--w-color-primary-30),
|
|
6
|
+
'primary-40': var(--w-color-primary-40),
|
|
7
|
+
'primary-50': var(--w-color-primary-50),
|
|
8
|
+
'primary-60': var(--w-color-primary-60),
|
|
9
|
+
'primary-70': var(--w-color-primary-70),
|
|
10
|
+
|
|
11
|
+
'info': var(--w-color-info),
|
|
12
|
+
'info-accent': var(--w-color-info-accent),
|
|
13
|
+
'info-fg': var(--w-color-info-fg),
|
|
14
|
+
'success': var(--w-color-success),
|
|
15
|
+
'success-accent': var(--w-color-success-accent),
|
|
16
|
+
'success-fg': var(--w-color-success-fg),
|
|
17
|
+
'warning': var(--w-color-warning),
|
|
18
|
+
'warning-accent': var(--w-color-warning-accent),
|
|
19
|
+
'warning-fg': var(--w-color-warning-fg),
|
|
20
|
+
'alert': var(--w-color-alert),
|
|
21
|
+
'alert-accent': var(--w-color-alert-accent),
|
|
22
|
+
'alert-fg': var(--w-color-alert-fg),
|
|
23
|
+
'overlay': var(--w-color-overlay)
|
|
24
|
+
) !default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
$overflowValues: auto,
|
|
2
|
+
hidden,
|
|
3
|
+
overlay,
|
|
4
|
+
scroll,
|
|
5
|
+
visible !default;
|
|
6
|
+
|
|
7
|
+
$displayValues: inline,
|
|
8
|
+
block,
|
|
9
|
+
contents,
|
|
10
|
+
flex,
|
|
11
|
+
flow,
|
|
12
|
+
flow-root,
|
|
13
|
+
grid,
|
|
14
|
+
inline-block,
|
|
15
|
+
inline-flex,
|
|
16
|
+
inline-grid,
|
|
17
|
+
inline-table,
|
|
18
|
+
list-item,
|
|
19
|
+
run-in,
|
|
20
|
+
table,
|
|
21
|
+
table-caption,
|
|
22
|
+
table-column-group,
|
|
23
|
+
table-header-group,
|
|
24
|
+
table-footer-group,
|
|
25
|
+
table-row-group,
|
|
26
|
+
table-cell,
|
|
27
|
+
table-column,
|
|
28
|
+
table-row,
|
|
29
|
+
none !default;
|
|
30
|
+
|
|
31
|
+
$positionValues: absolute,
|
|
32
|
+
fixed,
|
|
33
|
+
relative,
|
|
34
|
+
static,
|
|
35
|
+
sticky !default;
|
|
36
|
+
|
|
37
|
+
$flexDirectionValues: row
|
|
38
|
+
column
|
|
39
|
+
row-reverse
|
|
40
|
+
column-reverse !default;
|
|
41
|
+
|
|
42
|
+
$flexWrapValues: wrap
|
|
43
|
+
nowrap
|
|
44
|
+
wrap-reverse !default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
$breakpoints: (
|
|
2
|
+
'xs': 600px,
|
|
3
|
+
'sm': 800px,
|
|
4
|
+
'md': 1024px,
|
|
5
|
+
'lg': 1200px
|
|
6
|
+
) !default;
|
|
7
|
+
|
|
8
|
+
$layers: (
|
|
9
|
+
'bg': -1,
|
|
10
|
+
'default': 0,
|
|
11
|
+
'fg': 1,
|
|
12
|
+
'overlay': 2,
|
|
13
|
+
'popup': 3,
|
|
14
|
+
'top': 98,
|
|
15
|
+
'header': 99,
|
|
16
|
+
'modal': 100
|
|
17
|
+
) !default;
|
|
18
|
+
|
|
19
|
+
$radius: (
|
|
20
|
+
'none': 0,
|
|
21
|
+
'sm': var(--w-sm-radius),
|
|
22
|
+
'md': var(--w-md-radius),
|
|
23
|
+
'lg': var(--w-lg-radius),
|
|
24
|
+
'xl': var(--w-xl-radius),
|
|
25
|
+
'max': 100%
|
|
26
|
+
) !default;
|
|
27
|
+
|
|
28
|
+
$spacing: (
|
|
29
|
+
'none': 0,
|
|
30
|
+
'xxs': 2px,
|
|
31
|
+
'xs': 5px,
|
|
32
|
+
'sm': 10px,
|
|
33
|
+
'md': 15px,
|
|
34
|
+
'default': 20px,
|
|
35
|
+
'lg': 25px,
|
|
36
|
+
'xl': 30px,
|
|
37
|
+
'2xl': 35px,
|
|
38
|
+
'3xl': 40px,
|
|
39
|
+
'4xl': 45px,
|
|
40
|
+
'5xl': 50px
|
|
41
|
+
) !default;
|
package/scss/config/mixins.scss
CHANGED
|
@@ -1,16 +1,399 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'sass:list';
|
|
4
|
+
@use 'sass:string';
|
|
5
|
+
|
|
6
|
+
@mixin background($arg) {
|
|
7
|
+
background: map.get($colorPalette, '#{$arg}') or $arg;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
@mixin border($args...) {
|
|
11
|
+
$width: 1px;
|
|
12
|
+
$color: map.get($colorPalette, primary);
|
|
13
|
+
$position: border;
|
|
14
|
+
$positions: (
|
|
15
|
+
'top': border-top,
|
|
16
|
+
'bottom': border-bottom,
|
|
17
|
+
'left': border-left,
|
|
18
|
+
'right': border-right,
|
|
19
|
+
'x': (border-left, border-right),
|
|
20
|
+
'y': (border-top, border-bottom)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
@each $arg in $args {
|
|
24
|
+
@if (map.get($colorPalette, '#{$arg}') or meta.type-of($arg) == color) {
|
|
25
|
+
$color: map.get($colorPalette, '#{$arg}') or $arg;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@if (meta.type-of($arg) == 'number') {
|
|
29
|
+
$width: $arg;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@if (map.get($positions, $arg)) {
|
|
33
|
+
$position: map.get($positions, $arg);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@if ($width != 0 and $color) {
|
|
38
|
+
@each $key in $position {
|
|
39
|
+
#{$key}: $width solid $color;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@if ($width == 0) {
|
|
44
|
+
@each $key in $position {
|
|
45
|
+
#{$key}: $width;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@mixin border-radius($args...) {
|
|
51
|
+
$borderRadius: map.get($radius, 'md');
|
|
52
|
+
$position: null;
|
|
53
|
+
|
|
54
|
+
@each $arg in $args {
|
|
55
|
+
@if (map.get($radius, $arg)) {
|
|
56
|
+
$borderRadius: map.get($radius, $arg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
$side: (
|
|
60
|
+
top: $borderRadius $borderRadius 0 0,
|
|
61
|
+
bottom: 0 0 $borderRadius $borderRadius,
|
|
62
|
+
left: $borderRadius 0 0 $borderRadius,
|
|
63
|
+
right: 0 $borderRadius $borderRadius 0,
|
|
64
|
+
diagonal: $borderRadius 0,
|
|
65
|
+
reverse-diagonal: 0 $borderRadius
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
@if (map.get($side, $arg)) {
|
|
69
|
+
$position: map.get($side, $arg);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
border-radius: $position or $borderRadius;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@mixin layer($stack: 'default') {
|
|
77
|
+
z-index: #{map.get($layers, $stack)};
|
|
3
78
|
}
|
|
4
79
|
|
|
5
|
-
@mixin
|
|
6
|
-
$
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
80
|
+
@mixin layout($args...) {
|
|
81
|
+
$layouts: (flex, inline-flex, grid, inline-grid);
|
|
82
|
+
$alignments: (
|
|
83
|
+
vertical: (
|
|
84
|
+
'v-center': center,
|
|
85
|
+
'v-start': flex-start,
|
|
86
|
+
'v-end': flex-end,
|
|
87
|
+
'v-baseline': baseline,
|
|
88
|
+
'v-stretch': stretch
|
|
89
|
+
),
|
|
90
|
+
horizontal: (
|
|
91
|
+
'h-center': center,
|
|
92
|
+
'h-start': flex-start,
|
|
93
|
+
'h-end': flex-end,
|
|
94
|
+
'h-between': space-between,
|
|
95
|
+
'h-around': space-around,
|
|
96
|
+
'h-evenly': space-evenly,
|
|
97
|
+
'h-stretch': stretch
|
|
98
|
+
)
|
|
11
99
|
);
|
|
12
100
|
|
|
13
|
-
@
|
|
101
|
+
@each $arg in $args {
|
|
102
|
+
@if (list.index($layouts, $arg)) {
|
|
103
|
+
display: $arg;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
@if (map.get($spacing, $arg)) {
|
|
107
|
+
gap: map.get($spacing, $arg);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
@if (meta.type-of($arg) == 'string') {
|
|
111
|
+
@if (string.index($arg, 'v-')) {
|
|
112
|
+
align-items: map.get(map.get($alignments, vertical), $arg)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@if (string.index($arg, 'h-')) {
|
|
116
|
+
justify-content: map.get(map.get($alignments, horizontal), $arg)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@if ($arg == 'center') {
|
|
121
|
+
align-items: center;
|
|
122
|
+
justify-content: center;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
@if (list.index($flexDirectionValues, $arg)) {
|
|
126
|
+
flex-direction: $arg;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
@if (meta.type-of($arg) == 'number') {
|
|
130
|
+
grid-template-columns: repeat($arg, minmax(0, 1fr));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@if (list.index($flexWrapValues, $arg)) {
|
|
134
|
+
flex-wrap: $arg;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@mixin media($breakpoint: 'xs') {
|
|
140
|
+
@media (min-width: #{map.get($breakpoints, $breakpoint)}) {
|
|
14
141
|
@content;
|
|
15
142
|
}
|
|
16
143
|
}
|
|
144
|
+
|
|
145
|
+
@mixin position($args...) {
|
|
146
|
+
@each $arg in $args {
|
|
147
|
+
@if (list.index($positionValues, $arg)) {
|
|
148
|
+
position: $arg;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@if (string.index($arg, 't') == 1) {
|
|
152
|
+
top: #{list.nth(string.split($arg, 't'), 2)};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@if (string.index($arg, 'b') == 1) {
|
|
156
|
+
bottom: #{list.nth(string.split($arg, 'b'), 2)};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
@if (string.index($arg, 'l') == 1) {
|
|
160
|
+
left: #{list.nth(string.split($arg, 'l'), 2)};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@if (string.index($arg, 'r') == 1 and $arg != relative) {
|
|
164
|
+
right: #{list.nth(string.split($arg, 'r'), 2)};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@if ($arg == 'h-center') {
|
|
168
|
+
left: 50%;
|
|
169
|
+
transform: translateX(-50%);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
@if ($arg == 'v-center') {
|
|
173
|
+
top: 50%;
|
|
174
|
+
transform: translateY(-50%);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@if ($arg == 'center') {
|
|
178
|
+
top: 50%;
|
|
179
|
+
left: 50%;
|
|
180
|
+
transform: translate(-50%, -50%);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
@mixin size($args...) {
|
|
186
|
+
$singlePrefix: string.slice(list.nth(#{$args}, 1), 1, 1);
|
|
187
|
+
$isSingle: list.length($args) == 1
|
|
188
|
+
and $singlePrefix != 'w'
|
|
189
|
+
and $singlePrefix != 'h';
|
|
190
|
+
|
|
191
|
+
@if ($isSingle) {
|
|
192
|
+
width: $args;
|
|
193
|
+
height: $args;
|
|
194
|
+
} @else {
|
|
195
|
+
@each $arg in $args {
|
|
196
|
+
@if (meta.type-of($arg) == string) {
|
|
197
|
+
$prefix: string.slice($arg, 1, 1);
|
|
198
|
+
$value: string.slice($arg, 2, -1);
|
|
199
|
+
|
|
200
|
+
@if ($prefix == 'w') {
|
|
201
|
+
width: string.unquote($value);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
@if ($prefix == 'h') {
|
|
205
|
+
height: string.unquote($value);
|
|
206
|
+
}
|
|
207
|
+
} @else {
|
|
208
|
+
@if (index($args, $arg) == 1) {
|
|
209
|
+
width: $arg;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@if (index($args, $arg) == 2) {
|
|
213
|
+
height: $arg;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@mixin spacing($args...) {
|
|
221
|
+
$margin: (0 0 0 0);
|
|
222
|
+
$padding: (0 0 0 0);
|
|
223
|
+
$size: 'none';
|
|
224
|
+
$mx: 0;
|
|
225
|
+
$my: 0;
|
|
226
|
+
$px: 0;
|
|
227
|
+
$py: 0;
|
|
228
|
+
|
|
229
|
+
$marginMap: (
|
|
230
|
+
'mt': 1,
|
|
231
|
+
'mr': 2,
|
|
232
|
+
'mb': 3,
|
|
233
|
+
'ml': 4
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
$paddingMap: (
|
|
237
|
+
'pt': 1,
|
|
238
|
+
'pr': 2,
|
|
239
|
+
'pb': 3,
|
|
240
|
+
'pl': 4
|
|
241
|
+
);
|
|
242
|
+
|
|
243
|
+
@each $arg in $args {
|
|
244
|
+
@if (meta.type-of($arg) == string) {
|
|
245
|
+
$list: string.split($arg, '-');
|
|
246
|
+
$marginMapKey: map.get($marginMap, string.slice($arg, 1, 2));
|
|
247
|
+
$paddingMapKey: map.get($paddingMap, string.slice($arg, 1, 2));
|
|
248
|
+
|
|
249
|
+
@if (list.length($list) == 2) {
|
|
250
|
+
$size: map.get($spacing, list.nth(string.split($arg, '-'), 2));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Setting margins
|
|
254
|
+
@if ($marginMapKey) {
|
|
255
|
+
$margin: list.set-nth(
|
|
256
|
+
$margin,
|
|
257
|
+
$marginMapKey,
|
|
258
|
+
$size
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
@if (string.index($arg, 'mx-')) {
|
|
263
|
+
$mx: $size;
|
|
264
|
+
$margin: ($my $mx);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
@if (string.index($arg, 'my-')) {
|
|
268
|
+
$my: $size;
|
|
269
|
+
$margin: ($my $mx);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@if (string.index($arg, 'm-')) {
|
|
273
|
+
$margin: $size;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
@if (string.index($arg, 'auto')) {
|
|
277
|
+
margin: map.get($spacing, $size) or $size auto;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@if ($arg == 'm0') {
|
|
281
|
+
margin: 0;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Setting paddings
|
|
285
|
+
@if ($paddingMapKey) {
|
|
286
|
+
$padding: list.set-nth(
|
|
287
|
+
$padding,
|
|
288
|
+
$paddingMapKey,
|
|
289
|
+
$size
|
|
290
|
+
);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
@if (string.index($arg, 'px-')) {
|
|
294
|
+
$px: $size;
|
|
295
|
+
$padding: ($py $px);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@if (string.index($arg, 'py-')) {
|
|
299
|
+
$py: $size;
|
|
300
|
+
$padding: ($py $px);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@if (string.index($arg, 'p-')) {
|
|
304
|
+
$padding: $size;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
@if ($arg == 'p0') {
|
|
308
|
+
padding: 0;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
@if (map.get($spacing, $arg)) {
|
|
313
|
+
margin: map.get($spacing, $arg);
|
|
314
|
+
padding: map.get($spacing, $arg);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
@if ($arg == 0) {
|
|
318
|
+
margin: 0;
|
|
319
|
+
padding: 0;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@if ($margin != (0 0 0 0)) {
|
|
324
|
+
margin: $margin;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
@if ($padding != (0 0 0 0)) {
|
|
328
|
+
padding: $padding;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@mixin transition($args...) {
|
|
333
|
+
$property: all;
|
|
334
|
+
$speed: .3s;
|
|
335
|
+
|
|
336
|
+
@each $arg in $args {
|
|
337
|
+
@if (meta.type-of($arg) == 'number') {
|
|
338
|
+
$speed: $arg;
|
|
339
|
+
} @else {
|
|
340
|
+
$property: $arg;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
transition: $property $speed cubic-bezier(0.4, 0.0, 0.2, 1);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
@mixin typography($args...) {
|
|
348
|
+
@each $arg in $args {
|
|
349
|
+
$color: map.get($colorPalette, '#{$arg}');
|
|
350
|
+
$type: map.get($fontTypes, '#{$arg}');
|
|
351
|
+
$size: map.get($fontSizes, '#{$arg}');
|
|
352
|
+
$height: map.get($lineHeights, '#{$arg}');
|
|
353
|
+
$decoration: map.get($decorations, '#{$arg}');
|
|
354
|
+
|
|
355
|
+
@if ($color) {
|
|
356
|
+
color: $color;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
@if ($type) {
|
|
360
|
+
font-family: $type;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
@if ($size) {
|
|
364
|
+
font-size: $size;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
@if list.index($fontWeights, $arg) {
|
|
368
|
+
font-weight: $arg;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@if list.index($textAlignValues, $arg) {
|
|
372
|
+
text-align: $arg;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
@if ($decoration) {
|
|
376
|
+
text-decoration: $decoration;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
@if ($height or (meta.type-of($arg) == 'number' and $arg < 100)) {
|
|
380
|
+
line-height: $height or $arg;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
@mixin visibility($args...) {
|
|
386
|
+
@each $arg in $args {
|
|
387
|
+
@if list.index($displayValues, $arg) {
|
|
388
|
+
display: $arg;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@if list.index($overflowValues, $arg) {
|
|
392
|
+
overflow: $arg;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
@if (meta.type-of($arg) == 'number') {
|
|
396
|
+
opacity: $arg;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|