ep-craft 0.1.2 → 0.1.4
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/dist/components/button/EpButton.vue.d.ts +7 -7
- package/dist/components/button/button.d.ts +4 -4
- package/dist/components/button/index.d.ts +2 -4
- package/dist/components/button/index.js +4 -6
- package/dist/index.css +1 -2
- package/dist/resolver.js +9 -12
- package/package.json +4 -2
- package/theme-chalk/src/affix.scss +7 -0
- package/theme-chalk/src/alert.scss +115 -0
- package/theme-chalk/src/anchor-link.scss +45 -0
- package/theme-chalk/src/anchor.scss +93 -0
- package/theme-chalk/src/aside.scss +8 -0
- package/theme-chalk/src/autocomplete.scss +95 -0
- package/theme-chalk/src/avatar-group.scss +25 -0
- package/theme-chalk/src/avatar.scss +55 -0
- package/theme-chalk/src/backtop.scss +29 -0
- package/theme-chalk/src/badge.scss +58 -0
- package/theme-chalk/src/base.scss +3 -0
- package/theme-chalk/src/breadcrumb-item.scss +58 -0
- package/theme-chalk/src/breadcrumb.scss +9 -0
- package/theme-chalk/src/button-group.scss +133 -0
- package/theme-chalk/src/button.scss +374 -0
- package/theme-chalk/src/calendar.scss +94 -0
- package/theme-chalk/src/card.scss +49 -0
- package/theme-chalk/src/carousel-item.scss +58 -0
- package/theme-chalk/src/carousel.scss +195 -0
- package/theme-chalk/src/cascader-panel.scss +150 -0
- package/theme-chalk/src/cascader.scss +289 -0
- package/theme-chalk/src/check-tag.scss +60 -0
- package/theme-chalk/src/checkbox-button.scss +142 -0
- package/theme-chalk/src/checkbox-group.scss +7 -0
- package/theme-chalk/src/checkbox.scss +300 -0
- package/theme-chalk/src/col.scss +56 -0
- package/theme-chalk/src/collapse-item.scss +72 -0
- package/theme-chalk/src/collapse-transition.scss +1 -0
- package/theme-chalk/src/collapse.scss +29 -0
- package/theme-chalk/src/color/index.scss +20 -0
- package/theme-chalk/src/color-picker-panel.scss +294 -0
- package/theme-chalk/src/color-picker.scss +165 -0
- package/theme-chalk/src/common/popup.scss +47 -0
- package/theme-chalk/src/common/transition.scss +125 -0
- package/theme-chalk/src/common/var.scss +1748 -0
- package/theme-chalk/src/config-provider.scss +0 -0
- package/theme-chalk/src/container.scss +14 -0
- package/theme-chalk/src/dark/css-vars.scss +45 -0
- package/theme-chalk/src/dark/var.scss +224 -0
- package/theme-chalk/src/date-picker/date-picker.scss +121 -0
- package/theme-chalk/src/date-picker/date-range-picker.scss +165 -0
- package/theme-chalk/src/date-picker/date-table.scss +164 -0
- package/theme-chalk/src/date-picker/month-table.scss +112 -0
- package/theme-chalk/src/date-picker/picker-panel.scss +152 -0
- package/theme-chalk/src/date-picker/picker.scss +217 -0
- package/theme-chalk/src/date-picker/time-picker.scss +90 -0
- package/theme-chalk/src/date-picker/time-range-picker.scss +33 -0
- package/theme-chalk/src/date-picker/time-spinner.scss +115 -0
- package/theme-chalk/src/date-picker/utils.scss +14 -0
- package/theme-chalk/src/date-picker/year-table.scss +108 -0
- package/theme-chalk/src/date-picker-panel.scss +34 -0
- package/theme-chalk/src/date-picker.scss +0 -0
- package/theme-chalk/src/descriptions-item.scss +77 -0
- package/theme-chalk/src/descriptions.scss +151 -0
- package/theme-chalk/src/dialog.scss +207 -0
- package/theme-chalk/src/display.scss +12 -0
- package/theme-chalk/src/divider.scss +48 -0
- package/theme-chalk/src/drawer.scss +251 -0
- package/theme-chalk/src/dropdown-item.scss +0 -0
- package/theme-chalk/src/dropdown-menu.scss +0 -0
- package/theme-chalk/src/dropdown.scss +208 -0
- package/theme-chalk/src/empty.scss +49 -0
- package/theme-chalk/src/footer.scss +12 -0
- package/theme-chalk/src/form-item.scss +246 -0
- package/theme-chalk/src/form.scss +28 -0
- package/theme-chalk/src/header.scss +12 -0
- package/theme-chalk/src/icon.scss +41 -0
- package/theme-chalk/src/image-viewer.scss +161 -0
- package/theme-chalk/src/image.scss +49 -0
- package/theme-chalk/src/index.scss +116 -0
- package/theme-chalk/src/infinite-scroll.scss +0 -0
- package/theme-chalk/src/input-number.scss +192 -0
- package/theme-chalk/src/input-otp.scss +191 -0
- package/theme-chalk/src/input-tag.scss +249 -0
- package/theme-chalk/src/input.scss +541 -0
- package/theme-chalk/src/link.scss +90 -0
- package/theme-chalk/src/loading.scss +104 -0
- package/theme-chalk/src/main.scss +14 -0
- package/theme-chalk/src/mention.scss +88 -0
- package/theme-chalk/src/menu-item-group.scss +0 -0
- package/theme-chalk/src/menu-item.scss +0 -0
- package/theme-chalk/src/menu.scss +376 -0
- package/theme-chalk/src/message-box.scss +220 -0
- package/theme-chalk/src/message.scss +123 -0
- package/theme-chalk/src/mixins/_button.scss +240 -0
- package/theme-chalk/src/mixins/_col.scss +41 -0
- package/theme-chalk/src/mixins/_var.scss +67 -0
- package/theme-chalk/src/mixins/config.scss +5 -0
- package/theme-chalk/src/mixins/function.scss +99 -0
- package/theme-chalk/src/mixins/mixins.scss +257 -0
- package/theme-chalk/src/mixins/utils.scss +39 -0
- package/theme-chalk/src/notification.scss +109 -0
- package/theme-chalk/src/option-group.scss +33 -0
- package/theme-chalk/src/option.scss +71 -0
- package/theme-chalk/src/overlay.scss +17 -0
- package/theme-chalk/src/page-header.scss +60 -0
- package/theme-chalk/src/pagination.scss +235 -0
- package/theme-chalk/src/popconfirm.scss +17 -0
- package/theme-chalk/src/popover.scss +61 -0
- package/theme-chalk/src/popper.scss +117 -0
- package/theme-chalk/src/progress.scss +179 -0
- package/theme-chalk/src/radio-button.scss +165 -0
- package/theme-chalk/src/radio-group.scss +9 -0
- package/theme-chalk/src/radio.scss +220 -0
- package/theme-chalk/src/rate.scss +121 -0
- package/theme-chalk/src/reset.scss +99 -0
- package/theme-chalk/src/result.scss +57 -0
- package/theme-chalk/src/row.scss +34 -0
- package/theme-chalk/src/scrollbar.scss +97 -0
- package/theme-chalk/src/segmented.scss +186 -0
- package/theme-chalk/src/select-dropdown-v2.scss +1 -0
- package/theme-chalk/src/select-dropdown.scss +57 -0
- package/theme-chalk/src/select-v2.scss +4 -0
- package/theme-chalk/src/select.scss +269 -0
- package/theme-chalk/src/skeleton-item.scss +83 -0
- package/theme-chalk/src/skeleton.scss +44 -0
- package/theme-chalk/src/slider.scss +212 -0
- package/theme-chalk/src/space.scss +20 -0
- package/theme-chalk/src/spinner.scss +43 -0
- package/theme-chalk/src/splitter-panel.scss +8 -0
- package/theme-chalk/src/splitter.scss +148 -0
- package/theme-chalk/src/statistic.scss +35 -0
- package/theme-chalk/src/step.scss +320 -0
- package/theme-chalk/src/steps.scss +22 -0
- package/theme-chalk/src/sub-menu.scss +0 -0
- package/theme-chalk/src/switch.scss +294 -0
- package/theme-chalk/src/tab-pane.scss +0 -0
- package/theme-chalk/src/table-column.scss +100 -0
- package/theme-chalk/src/table-v2.scss +239 -0
- package/theme-chalk/src/table.scss +698 -0
- package/theme-chalk/src/tabs.scss +699 -0
- package/theme-chalk/src/tag.scss +195 -0
- package/theme-chalk/src/text.scss +51 -0
- package/theme-chalk/src/time-picker.scss +5 -0
- package/theme-chalk/src/time-select.scss +37 -0
- package/theme-chalk/src/timeline-item.scss +135 -0
- package/theme-chalk/src/timeline.scss +101 -0
- package/theme-chalk/src/tooltip.scss +0 -0
- package/theme-chalk/src/tour.scss +187 -0
- package/theme-chalk/src/transfer.scss +201 -0
- package/theme-chalk/src/tree-select.scss +41 -0
- package/theme-chalk/src/tree.scss +134 -0
- package/theme-chalk/src/upload.scss +660 -0
- package/theme-chalk/src/var.scss +87 -0
- package/theme-chalk/src/virtual-list.scss +40 -0
- package/dist/components/button/EpButton.vue.js +0 -171
- package/dist/components/button/EpButton2.vue.js +0 -4
- package/dist/components/button/button.js +0 -95
- package/dist/node_modules/@ctrl/tinycolor/dist/module/conversion.js +0 -134
- package/dist/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +0 -153
- package/dist/node_modules/@ctrl/tinycolor/dist/module/format-input.js +0 -77
- package/dist/node_modules/@ctrl/tinycolor/dist/module/index.js +0 -354
- package/dist/node_modules/@ctrl/tinycolor/dist/module/util.js +0 -32
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
@use 'mixins/mixins' as *;
|
|
2
|
+
@use 'mixins/var' as *;
|
|
3
|
+
@use 'common/var' as *;
|
|
4
|
+
|
|
5
|
+
@include b(message) {
|
|
6
|
+
@include set-component-css-var('message', $message);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@include b(message) {
|
|
10
|
+
width: max-content;
|
|
11
|
+
max-width: calc(100% - 32px);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
border-radius: getCssVar('border-radius-base');
|
|
14
|
+
border-width: getCssVar('border-width');
|
|
15
|
+
border-style: getCssVar('border-style');
|
|
16
|
+
border-color: getCssVar('message', 'border-color');
|
|
17
|
+
position: fixed;
|
|
18
|
+
background-color: getCssVar('message', 'bg-color');
|
|
19
|
+
transition:
|
|
20
|
+
opacity getCssVar('transition-duration'),
|
|
21
|
+
transform 0.4s,
|
|
22
|
+
top 0.4s,
|
|
23
|
+
bottom 0.4s;
|
|
24
|
+
padding: getCssVar('message', 'padding');
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
|
|
29
|
+
&.is-left {
|
|
30
|
+
left: 16px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.is-right {
|
|
34
|
+
right: 16px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.is-center {
|
|
38
|
+
left: 50%;
|
|
39
|
+
transform: translateX(-50%);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include when(plain) {
|
|
43
|
+
background-color: getCssVar('bg-color', 'overlay');
|
|
44
|
+
border-color: getCssVar('bg-color', 'overlay');
|
|
45
|
+
box-shadow: getCssVar('box-shadow-light');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
p {
|
|
49
|
+
margin: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@each $type in (primary, success, info, warning, error) {
|
|
53
|
+
@include m($type) {
|
|
54
|
+
@include css-var-from-global(
|
|
55
|
+
('message', 'bg-color'),
|
|
56
|
+
('color', $type, 'light-9')
|
|
57
|
+
);
|
|
58
|
+
@include css-var-from-global(
|
|
59
|
+
('message', 'border-color'),
|
|
60
|
+
('color', $type, 'light-8')
|
|
61
|
+
);
|
|
62
|
+
@include css-var-from-global(('message', 'text-color'), ('color', $type));
|
|
63
|
+
|
|
64
|
+
.#{$namespace}-message__content {
|
|
65
|
+
color: getCssVar('message', 'text-color');
|
|
66
|
+
overflow-wrap: break-word;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
& .#{$namespace}-message-icon--#{$type} {
|
|
71
|
+
color: getCssVar('message', 'text-color');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.#{$namespace}-message__badge {
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: -8px;
|
|
78
|
+
right: -8px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@include e(content) {
|
|
82
|
+
padding: 0;
|
|
83
|
+
font-size: 14px;
|
|
84
|
+
line-height: 1;
|
|
85
|
+
&:focus {
|
|
86
|
+
outline-width: 0;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
& .#{$namespace}-message__closeBtn {
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
color: getCssVar('message', 'close-icon-color');
|
|
93
|
+
font-size: getCssVar('message', 'close-size');
|
|
94
|
+
|
|
95
|
+
&:focus {
|
|
96
|
+
outline-width: 0;
|
|
97
|
+
}
|
|
98
|
+
&:hover {
|
|
99
|
+
color: getCssVar('message', 'close-hover-color');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.#{$namespace}-message-fade-enter-from,
|
|
105
|
+
.#{$namespace}-message-fade-leave-to {
|
|
106
|
+
opacity: 0;
|
|
107
|
+
&.is-left,
|
|
108
|
+
&.is-right {
|
|
109
|
+
transform: translateY(-100%);
|
|
110
|
+
|
|
111
|
+
&.is-bottom {
|
|
112
|
+
transform: translateY(100%);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&.is-center {
|
|
117
|
+
transform: translate(-50%, -100%);
|
|
118
|
+
|
|
119
|
+
&.is-bottom {
|
|
120
|
+
transform: translate(-50%, 100%);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
@use '../mixins/var' as *;
|
|
2
|
+
@use '../mixins/function' as *;
|
|
3
|
+
@use '../common/var' as *;
|
|
4
|
+
|
|
5
|
+
@mixin button-plain($type) {
|
|
6
|
+
$button-color-types: (
|
|
7
|
+
'': (
|
|
8
|
+
'text-color': (
|
|
9
|
+
'color',
|
|
10
|
+
$type,
|
|
11
|
+
),
|
|
12
|
+
'bg-color': (
|
|
13
|
+
'color',
|
|
14
|
+
$type,
|
|
15
|
+
'light-9',
|
|
16
|
+
),
|
|
17
|
+
'border-color': (
|
|
18
|
+
'color',
|
|
19
|
+
$type,
|
|
20
|
+
'light-5',
|
|
21
|
+
),
|
|
22
|
+
),
|
|
23
|
+
'hover': (
|
|
24
|
+
'text-color': (
|
|
25
|
+
'color',
|
|
26
|
+
'white',
|
|
27
|
+
),
|
|
28
|
+
'bg-color': (
|
|
29
|
+
'color',
|
|
30
|
+
$type,
|
|
31
|
+
),
|
|
32
|
+
'border-color': (
|
|
33
|
+
'color',
|
|
34
|
+
$type,
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
'active': (
|
|
38
|
+
'text-color': (
|
|
39
|
+
'color',
|
|
40
|
+
'white',
|
|
41
|
+
),
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
@each $type, $typeMap in $button-color-types {
|
|
46
|
+
@each $typeColor, $list in $typeMap {
|
|
47
|
+
@include css-var-from-global(('button', $type, $typeColor), $list);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.is-disabled {
|
|
52
|
+
&,
|
|
53
|
+
&:hover,
|
|
54
|
+
&:focus,
|
|
55
|
+
&:active {
|
|
56
|
+
color: getCssVar('color', $type, 'light-5');
|
|
57
|
+
background-color: getCssVar('color', $type, 'light-9');
|
|
58
|
+
border-color: getCssVar('color', $type, 'light-8');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@mixin button-dashed($type) {
|
|
64
|
+
$button-color-types: (
|
|
65
|
+
'': (
|
|
66
|
+
'text-color': (
|
|
67
|
+
'color',
|
|
68
|
+
$type,
|
|
69
|
+
),
|
|
70
|
+
'bg-color': (
|
|
71
|
+
'color',
|
|
72
|
+
$type,
|
|
73
|
+
'light-9',
|
|
74
|
+
),
|
|
75
|
+
'border-color': (
|
|
76
|
+
'color',
|
|
77
|
+
$type,
|
|
78
|
+
'light-5',
|
|
79
|
+
),
|
|
80
|
+
),
|
|
81
|
+
'hover': (
|
|
82
|
+
'text-color': (
|
|
83
|
+
'color',
|
|
84
|
+
$type,
|
|
85
|
+
),
|
|
86
|
+
'bg-color': (
|
|
87
|
+
'color',
|
|
88
|
+
$type,
|
|
89
|
+
'light-9',
|
|
90
|
+
),
|
|
91
|
+
'border-color': (
|
|
92
|
+
'color',
|
|
93
|
+
$type,
|
|
94
|
+
'light-3',
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
'active': (
|
|
98
|
+
'text-color': (
|
|
99
|
+
'color',
|
|
100
|
+
$type,
|
|
101
|
+
'dark-2',
|
|
102
|
+
),
|
|
103
|
+
'bg-color': (
|
|
104
|
+
'color',
|
|
105
|
+
$type,
|
|
106
|
+
'light-9',
|
|
107
|
+
),
|
|
108
|
+
'border-color': (
|
|
109
|
+
'color',
|
|
110
|
+
$type,
|
|
111
|
+
'dark-2',
|
|
112
|
+
),
|
|
113
|
+
),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
@each $type, $typeMap in $button-color-types {
|
|
117
|
+
@each $typeColor, $list in $typeMap {
|
|
118
|
+
@include css-var-from-global(('button', $type, $typeColor), $list);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.is-disabled {
|
|
123
|
+
&,
|
|
124
|
+
&:hover,
|
|
125
|
+
&:focus,
|
|
126
|
+
&:active {
|
|
127
|
+
color: getCssVar('color', $type, 'light-5');
|
|
128
|
+
background-color: getCssVar('color', $type, 'light-9');
|
|
129
|
+
border-color: getCssVar('color', $type, 'light-8');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@mixin button-variant($type) {
|
|
135
|
+
$button-color-types: (
|
|
136
|
+
'': (
|
|
137
|
+
'text-color': (
|
|
138
|
+
'color',
|
|
139
|
+
'white',
|
|
140
|
+
),
|
|
141
|
+
'bg-color': (
|
|
142
|
+
'color',
|
|
143
|
+
$type,
|
|
144
|
+
),
|
|
145
|
+
'border-color': (
|
|
146
|
+
'color',
|
|
147
|
+
$type,
|
|
148
|
+
),
|
|
149
|
+
'outline-color': (
|
|
150
|
+
'color',
|
|
151
|
+
$type,
|
|
152
|
+
'light-5',
|
|
153
|
+
),
|
|
154
|
+
'active-color': (
|
|
155
|
+
'color',
|
|
156
|
+
$type,
|
|
157
|
+
'dark-2',
|
|
158
|
+
),
|
|
159
|
+
),
|
|
160
|
+
'hover': (
|
|
161
|
+
'text-color': (
|
|
162
|
+
'color',
|
|
163
|
+
'white',
|
|
164
|
+
),
|
|
165
|
+
'link-text-color': (
|
|
166
|
+
'color',
|
|
167
|
+
$type,
|
|
168
|
+
'light-5',
|
|
169
|
+
),
|
|
170
|
+
'bg-color': (
|
|
171
|
+
'color',
|
|
172
|
+
$type,
|
|
173
|
+
'light-3',
|
|
174
|
+
),
|
|
175
|
+
'border-color': (
|
|
176
|
+
'color',
|
|
177
|
+
$type,
|
|
178
|
+
'light-3',
|
|
179
|
+
),
|
|
180
|
+
),
|
|
181
|
+
'active': (
|
|
182
|
+
'bg-color': (
|
|
183
|
+
'color',
|
|
184
|
+
$type,
|
|
185
|
+
'dark-2',
|
|
186
|
+
),
|
|
187
|
+
'border-color': (
|
|
188
|
+
'color',
|
|
189
|
+
$type,
|
|
190
|
+
'dark-2',
|
|
191
|
+
),
|
|
192
|
+
),
|
|
193
|
+
'disabled': (
|
|
194
|
+
'text-color': (
|
|
195
|
+
'color',
|
|
196
|
+
'white',
|
|
197
|
+
),
|
|
198
|
+
'bg-color': (
|
|
199
|
+
'color',
|
|
200
|
+
$type,
|
|
201
|
+
'light-5',
|
|
202
|
+
),
|
|
203
|
+
'border-color': (
|
|
204
|
+
'color',
|
|
205
|
+
$type,
|
|
206
|
+
'light-5',
|
|
207
|
+
),
|
|
208
|
+
),
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
@each $type, $typeMap in $button-color-types {
|
|
212
|
+
@each $typeColor, $list in $typeMap {
|
|
213
|
+
@include css-var-from-global(('button', $type, $typeColor), $list);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.is-plain,
|
|
218
|
+
&.is-text,
|
|
219
|
+
&.is-link {
|
|
220
|
+
@include button-plain($type);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&.is-dashed {
|
|
224
|
+
@include button-dashed($type);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
@mixin button-size(
|
|
229
|
+
$padding-vertical,
|
|
230
|
+
$padding-horizontal,
|
|
231
|
+
$font-size,
|
|
232
|
+
$border-radius
|
|
233
|
+
) {
|
|
234
|
+
padding: $padding-vertical $padding-horizontal;
|
|
235
|
+
font-size: $font-size;
|
|
236
|
+
border-radius: $border-radius;
|
|
237
|
+
&.is-round {
|
|
238
|
+
padding: $padding-vertical $padding-horizontal;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
3
|
+
@use '../common/var' as *;
|
|
4
|
+
@use './mixins' as *;
|
|
5
|
+
|
|
6
|
+
@mixin col-size($size) {
|
|
7
|
+
@include res($size) {
|
|
8
|
+
@for $i from 0 through 24 {
|
|
9
|
+
.#{$namespace}-col-#{$size}-#{$i} {
|
|
10
|
+
@if $i == 0 {
|
|
11
|
+
display: none;
|
|
12
|
+
} @else {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
max-width: (math.div(1, 24) * $i * 100) * 1%;
|
|
16
|
+
flex: 0 0 (math.div(1, 24) * $i * 100) * 1%;
|
|
17
|
+
@include when(guttered) {
|
|
18
|
+
@if $i == 0 {
|
|
19
|
+
display: none;
|
|
20
|
+
} @else {
|
|
21
|
+
display: block;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.#{$namespace}-col-#{$size}-offset-#{$i} {
|
|
27
|
+
margin-left: (math.div(1, 24) * $i * 100) * 1%;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.#{$namespace}-col-#{$size}-pull-#{$i} {
|
|
31
|
+
position: relative;
|
|
32
|
+
right: (math.div(1, 24) * $i * 100) * 1%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.#{$namespace}-col-#{$size}-push-#{$i} {
|
|
36
|
+
position: relative;
|
|
37
|
+
left: (math.div(1, 24) * $i * 100) * 1%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@use 'sass:map';
|
|
2
|
+
@use 'sass:color';
|
|
3
|
+
|
|
4
|
+
@use 'config';
|
|
5
|
+
@use 'function' as *;
|
|
6
|
+
@use '../common/var' as *;
|
|
7
|
+
|
|
8
|
+
// set css var value, because we need translate value to string
|
|
9
|
+
// for example:
|
|
10
|
+
// @include set-css-var-value(('color', 'primary'), red);
|
|
11
|
+
// --el-color-primary: red;
|
|
12
|
+
@mixin set-css-var-value($name, $value) {
|
|
13
|
+
#{joinVarName($name)}: #{$value};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// @include set-css-var-type('color', 'primary', $map);
|
|
17
|
+
// --el-color-primary: #{map.get($map, 'primary')};
|
|
18
|
+
@mixin set-css-var-type($name, $type, $variables) {
|
|
19
|
+
#{getCssVarName($name, $type)}: #{map.get($variables, $type)};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@mixin set-css-color-type($colors, $type) {
|
|
23
|
+
@include set-css-var-value(('color', $type), map.get($colors, $type, 'base'));
|
|
24
|
+
|
|
25
|
+
@each $i in (3, 5, 7, 8, 9) {
|
|
26
|
+
@include set-css-var-value(
|
|
27
|
+
('color', $type, 'light', $i),
|
|
28
|
+
map.get($colors, $type, 'light-#{$i}')
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@include set-css-var-value(
|
|
33
|
+
('color', $type, 'dark-2'),
|
|
34
|
+
map.get($colors, $type, 'dark-2')
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// set all css var for component by map
|
|
39
|
+
@mixin set-component-css-var($name, $variables) {
|
|
40
|
+
@each $attribute, $value in $variables {
|
|
41
|
+
@if $attribute == 'default' {
|
|
42
|
+
#{getCssVarName($name)}: #{$value};
|
|
43
|
+
} @else {
|
|
44
|
+
#{getCssVarName($name, $attribute)}: #{$value};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@mixin set-css-color-rgb($type) {
|
|
50
|
+
$color: map.get($colors, $type, 'base');
|
|
51
|
+
@include set-css-var-value(
|
|
52
|
+
('color', $type, 'rgb'),
|
|
53
|
+
#{color.channel($color, 'red', $space: rgb),
|
|
54
|
+
color.channel($color, 'green', $space: rgb),
|
|
55
|
+
color.channel($color, 'blue', $space: rgb)}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// generate css var from existing css var
|
|
60
|
+
// for example:
|
|
61
|
+
// @include css-var-from-global(('button', 'text-color'), ('color', $type))
|
|
62
|
+
// --el-button-text-color: var(--el-color-#{$type});
|
|
63
|
+
@mixin css-var-from-global($var, $gVar) {
|
|
64
|
+
$varName: joinVarName($var);
|
|
65
|
+
$gVarName: joinVarName($gVar);
|
|
66
|
+
#{$varName}: var(#{$gVarName});
|
|
67
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
@use 'config';
|
|
2
|
+
@use 'sass:meta';
|
|
3
|
+
@use 'sass:string';
|
|
4
|
+
@use 'sass:math';
|
|
5
|
+
@use 'sass:color';
|
|
6
|
+
|
|
7
|
+
// BEM support Func
|
|
8
|
+
@function selectorToString($selector) {
|
|
9
|
+
$selector: meta.inspect($selector);
|
|
10
|
+
$selector: string.slice($selector, 2, -2);
|
|
11
|
+
@return $selector;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@function containsModifier($selector) {
|
|
15
|
+
$selector: selectorToString($selector);
|
|
16
|
+
|
|
17
|
+
@if string.index($selector, config.$modifier-separator) {
|
|
18
|
+
@return true;
|
|
19
|
+
} @else {
|
|
20
|
+
@return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@function containWhenFlag($selector) {
|
|
25
|
+
$selector: selectorToString($selector);
|
|
26
|
+
|
|
27
|
+
@if string.index($selector, '.' + config.$state-prefix) {
|
|
28
|
+
@return true;
|
|
29
|
+
} @else {
|
|
30
|
+
@return false;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@function containPseudoClass($selector) {
|
|
35
|
+
$selector: selectorToString($selector);
|
|
36
|
+
|
|
37
|
+
@if string.index($selector, ':') {
|
|
38
|
+
@return true;
|
|
39
|
+
} @else {
|
|
40
|
+
@return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@function hitAllSpecialNestRule($selector) {
|
|
45
|
+
@return containsModifier($selector) or containWhenFlag($selector) or
|
|
46
|
+
containPseudoClass($selector);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// join var name
|
|
50
|
+
// joinVarName(('button', 'text-color')) => '--el-button-text-color'
|
|
51
|
+
@function joinVarName($list) {
|
|
52
|
+
$name: '--' + config.$namespace;
|
|
53
|
+
@each $item in $list {
|
|
54
|
+
@if $item != '' {
|
|
55
|
+
$name: $name + '-' + $item;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
@return $name;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// getCssVarName('button', 'text-color') => '--el-button-text-color'
|
|
62
|
+
@function getCssVarName($args...) {
|
|
63
|
+
@return joinVarName($args);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// getCssVar('button', 'text-color') => var(--el-button-text-color)
|
|
67
|
+
@function getCssVar($args...) {
|
|
68
|
+
@return var(#{joinVarName($args)});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// getCssVarWithDefault(('button', 'text-color'), red) => var(--el-button-text-color, red)
|
|
72
|
+
@function getCssVarWithDefault($args, $default) {
|
|
73
|
+
@return var(#{joinVarName($args)}, #{$default});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// bem('block', 'element', 'modifier') => 'el-block__element--modifier'
|
|
77
|
+
@function bem($block, $element: '', $modifier: '') {
|
|
78
|
+
$name: config.$namespace + config.$common-separator + $block;
|
|
79
|
+
|
|
80
|
+
@if $element != '' {
|
|
81
|
+
$name: $name + config.$element-separator + $element;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@if $modifier != '' {
|
|
85
|
+
$name: $name + config.$modifier-separator + $modifier;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// @debug $name;
|
|
89
|
+
@return $name;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@function roundColor($color) {
|
|
93
|
+
$r: math.round(color.channel($color, 'red'));
|
|
94
|
+
$g: math.round(color.channel($color, 'green'));
|
|
95
|
+
$b: math.round(color.channel($color, 'blue'));
|
|
96
|
+
$a: color.channel($color, 'alpha');
|
|
97
|
+
|
|
98
|
+
@return rgba($r, $g, $b, $a);
|
|
99
|
+
}
|