@fkui/design 5.36.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/LICENSE.md +7 -0
- package/README.md +3 -0
- package/lib/fkui-exp.css +7818 -0
- package/lib/fkui-exp.min.css +1 -0
- package/lib/fkui-int.css +7818 -0
- package/lib/fkui-int.min.css +1 -0
- package/lib/fonts.css +3 -0
- package/lib/fonts.min.css +1 -0
- package/package.json +70 -0
- package/src/_core.scss +1 -0
- package/src/assets/images/fk-logo-default.svg +22 -0
- package/src/assets/images/fk-logo-primary-large.svg +161 -0
- package/src/assets/images/fk-logo-primary-small.svg +1 -0
- package/src/assets/images/fk-logo-primary.svg +23 -0
- package/src/assets/images/fk-logo-small.svg +5 -0
- package/src/components/_all.scss +60 -0
- package/src/components/_z-index.scss +6 -0
- package/src/components/anchor/_anchor.scss +27 -0
- package/src/components/badge/_badge.scss +72 -0
- package/src/components/button/_button.scss +497 -0
- package/src/components/calendar-day/_calendar-day.scss +86 -0
- package/src/components/calendar-deprecated/_calendar-deprecated.scss +628 -0
- package/src/components/card/_card.scss +51 -0
- package/src/components/checkbox/_all.scss +2 -0
- package/src/components/checkbox/_checkbox-group.scss +18 -0
- package/src/components/checkbox/_checkbox.scss +111 -0
- package/src/components/chip/_chip.scss +91 -0
- package/src/components/close-button/_close-button.scss +16 -0
- package/src/components/contextmenu/_contextmenu.scss +54 -0
- package/src/components/crud-dataset/_crud-dataset.scss +18 -0
- package/src/components/datepicker-field/_datepicker-field.scss +76 -0
- package/src/components/dialogue-tree/_dialogue-tree.scss +54 -0
- package/src/components/entrypoint/_entrypoint.scss +40 -0
- package/src/components/error-list/_error-list.scss +54 -0
- package/src/components/expandable-panel/_expandable-panel.scss +113 -0
- package/src/components/expandable-paragraph/_expandable-paragraph.scss +97 -0
- package/src/components/fieldset/_fieldset.scss +22 -0
- package/src/components/file-item/_file-item.scss +80 -0
- package/src/components/file-selector/_file-selector.scss +28 -0
- package/src/components/file-uploader/_file-uploader.scss +7 -0
- package/src/components/form/_all.scss +2 -0
- package/src/components/form/_form-step.scss +91 -0
- package/src/components/form/_form.scss +8 -0
- package/src/components/group/_group.scss +8 -0
- package/src/components/icon/_icon.scss +175 -0
- package/src/components/indent/_indent.scss +11 -0
- package/src/components/label/_label.scss +47 -0
- package/src/components/layout-application-template/_layout-application-template.scss +75 -0
- package/src/components/layout-navigation/_layout-navigation.scss +124 -0
- package/src/components/layout-secondary/_layout-secondary.scss +129 -0
- package/src/components/list/_list.scss +117 -0
- package/src/components/loader/_loader.scss +179 -0
- package/src/components/message-box/_message-box.scss +121 -0
- package/src/components/modal/_modal.scss +190 -0
- package/src/components/navbar/_navbar-header.scss +77 -0
- package/src/components/navbar/_navbar-nav.scss +30 -0
- package/src/components/navbar/_navbar.scss +71 -0
- package/src/components/offline/_offline.scss +40 -0
- package/src/components/output-field/_output-field.scss +23 -0
- package/src/components/page-header/_page-header.scss +96 -0
- package/src/components/progressbar/_progressbar.scss +34 -0
- package/src/components/radio-button/_all.scss +2 -0
- package/src/components/radio-button/_item.scss +54 -0
- package/src/components/radio-button/_radio-button-group.scss +38 -0
- package/src/components/radio-button/_radio-button.scss +106 -0
- package/src/components/select-field/_select-field.scss +88 -0
- package/src/components/sort-filter-dataset/_sort-filter-dataset.scss +70 -0
- package/src/components/static-panel/_static-panel.scss +31 -0
- package/src/components/table/_table.scss +415 -0
- package/src/components/text-field/_text-field.scss +127 -0
- package/src/components/textarea-field/_textarea-field.scss +55 -0
- package/src/components/tooltip/_tooltip.scss +87 -0
- package/src/components/wizard/_all.scss +2 -0
- package/src/components/wizard/_wizard-step.scss +318 -0
- package/src/components/wizard/_wizard.scss +5 -0
- package/src/core/_all.scss +6 -0
- package/src/core/_config-variables.scss +23 -0
- package/src/core/_density.scss +11 -0
- package/src/core/_global.scss +47 -0
- package/src/core/_mixins.scss +8 -0
- package/src/core/_reset.scss +60 -0
- package/src/core/_size.scss +23 -0
- package/src/core/helpers/_all.scss +2 -0
- package/src/core/helpers/_helpers.scss +19 -0
- package/src/core/helpers/accessibility/_all.scss +2 -0
- package/src/core/helpers/accessibility/_focus.scss +24 -0
- package/src/core/helpers/accessibility/_screenreader.scss +11 -0
- package/src/core/layout/_all.scss +2 -0
- package/src/core/layout/grid/_all.scss +1 -0
- package/src/core/layout/grid/_grid.scss +135 -0
- package/src/core/layout/positioning/_all.scss +1 -0
- package/src/core/layout/positioning/_positioning.scss +16 -0
- package/src/core/mixins/_all.scss +9 -0
- package/src/core/mixins/_anchor.scss +17 -0
- package/src/core/mixins/_arrow-creator.scss +51 -0
- package/src/core/mixins/_breakpoints.scss +42 -0
- package/src/core/mixins/_button.scss +78 -0
- package/src/core/mixins/_button_icon.scss +51 -0
- package/src/core/mixins/_circle.scss +21 -0
- package/src/core/mixins/_focus.scss +4 -0
- package/src/core/mixins/_label-inline.scss +19 -0
- package/src/core/mixins/_sr-only.scss +11 -0
- package/src/core/typography/_all.scss +1 -0
- package/src/core/typography/_headings.scss +88 -0
- package/src/core/utils/_all.scss +1 -0
- package/src/core/utils/_functions.scss +41 -0
- package/src/fkui-exp.scss +1 -0
- package/src/fkui-int.scss +1 -0
- package/src/fkui.scss +3 -0
- package/src/fonts.scss +3 -0
- package/src/internal-components/IFlex/_iflex.scss +98 -0
- package/src/internal-components/IMenu/_imenu.scss +106 -0
- package/src/internal-components/IPopupMenu/_ipopupmenu.scss +50 -0
- package/src/internal-components/ISkipLink/_iskiplink.scss +16 -0
- package/src/internal-components/_all.scss +11 -0
- package/src/internal-components/animate-expand/_animate-expand.scss +17 -0
- package/src/internal-components/calendar/_calendar.scss +7 -0
- package/src/internal-components/calendar-month/_month.scss +74 -0
- package/src/internal-components/calendar-navbar/_navbar.scss +55 -0
- package/src/internal-components/popup/_popup.scss +35 -0
- package/src/internal-components/popupError/_popuperror.scss +116 -0
- package/src/internal-components/popupError/arrows/_bottom-before.scss +22 -0
- package/src/internal-components/popupError/arrows/_bottom.scss +19 -0
- package/src/internal-components/popupError/arrows/_left-before.scss +22 -0
- package/src/internal-components/popupError/arrows/_left.scss +19 -0
- package/src/internal-components/popupError/arrows/_right-before.scss +22 -0
- package/src/internal-components/popupError/arrows/_right.scss +19 -0
- package/src/internal-components/popupError/arrows/_top-before.scss +22 -0
- package/src/internal-components/popupError/arrows/_top.scss +19 -0
- package/stylelint/index.js +3 -0
- package/stylelint/recommended.js +6 -0
- package/stylelint/rules/deprecatedVariable/index.js +93 -0
- package/stylelint/rules/index.js +3 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
@use "../../core/size";
|
|
2
|
+
@use "../../components/z-index";
|
|
3
|
+
@use "arrows/top" as arrowTop;
|
|
4
|
+
@use "arrows/top-before" as arrowTopBefore;
|
|
5
|
+
@use "arrows/bottom" as arrowBottom;
|
|
6
|
+
@use "arrows/bottom-before" as arrowBottomBefore;
|
|
7
|
+
@use "arrows/left" as arrowLeft;
|
|
8
|
+
@use "arrows/left-before" as arrowLeftBefore;
|
|
9
|
+
@use "arrows/right" as arrowRight;
|
|
10
|
+
@use "arrows/right-before" as arrowRightBefore;
|
|
11
|
+
|
|
12
|
+
// With inspiration from:
|
|
13
|
+
// https://www.smashingmagazine.com/2024/03/modern-css-tooltips-speech-bubbles-part1/#comments-modern-css-tooltips-speech-bubbles-part1
|
|
14
|
+
$POPUP_ERROR_SELECTOR: ".popup-error" !default;
|
|
15
|
+
#{$POPUP_ERROR_SELECTOR} {
|
|
16
|
+
--i-popup-error-offset: 24px;
|
|
17
|
+
|
|
18
|
+
// Arrorw angle
|
|
19
|
+
$angle: 60deg;
|
|
20
|
+
|
|
21
|
+
// Arrow height
|
|
22
|
+
$height: 10px;
|
|
23
|
+
|
|
24
|
+
// Arrow position (0%:left 100%:right)
|
|
25
|
+
$pos: calc(100% - var(--i-popup-error-offset));
|
|
26
|
+
$radius: 0.2em;
|
|
27
|
+
$border-width: var(--f-border-width-medium);
|
|
28
|
+
$border-color: var(--f-border-color-error);
|
|
29
|
+
$bg-color: var(--f-background-error);
|
|
30
|
+
$offset: $height * tan($angle / 2);
|
|
31
|
+
|
|
32
|
+
&--overlay {
|
|
33
|
+
position: absolute;
|
|
34
|
+
|
|
35
|
+
// Place popup at the top as default so it doesn't affect
|
|
36
|
+
// the page height when teleporting to bottom of body.
|
|
37
|
+
top: 0;
|
|
38
|
+
|
|
39
|
+
#{$POPUP_ERROR_SELECTOR}__wrapper {
|
|
40
|
+
left: -10000px;
|
|
41
|
+
position: absolute;
|
|
42
|
+
z-index: z-index.$POPUP_ZINDEX;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&--inline {
|
|
48
|
+
position: static;
|
|
49
|
+
|
|
50
|
+
#{$POPUP_ERROR_SELECTOR}__wrapper {
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
margin-top: size.$margin-050;
|
|
53
|
+
margin-bottom: size.$margin-050;
|
|
54
|
+
position: static;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&--arrow {
|
|
59
|
+
display: flex;
|
|
60
|
+
justify-content: space-between;
|
|
61
|
+
padding: 0.5em 10px;
|
|
62
|
+
background: var(--f-border-color-error);
|
|
63
|
+
line-height: 24px;
|
|
64
|
+
position: relative;
|
|
65
|
+
|
|
66
|
+
#{$POPUP_ERROR_SELECTOR}__button {
|
|
67
|
+
margin: 0;
|
|
68
|
+
min-height: 24px;
|
|
69
|
+
min-width: 24px;
|
|
70
|
+
padding: 0;
|
|
71
|
+
padding-left: 5px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&--arrow::before {
|
|
76
|
+
content: "";
|
|
77
|
+
position: absolute;
|
|
78
|
+
z-index: -1;
|
|
79
|
+
inset: 0;
|
|
80
|
+
padding: $border-width;
|
|
81
|
+
border-radius: inherit;
|
|
82
|
+
background: $bg-color content-box;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&--top {
|
|
86
|
+
@include arrowTop.mixin($pos, $radius, $height, $angle, $border-color);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--bottom {
|
|
90
|
+
@include arrowBottom.mixin($pos, $radius, $height, $angle, $border-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&--left {
|
|
94
|
+
@include arrowLeft.mixin($pos, $radius, $height, $angle, $border-color);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--right {
|
|
98
|
+
@include arrowRight.mixin($pos, $radius, $height, $angle, $border-color);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&--top::before {
|
|
102
|
+
@include arrowTopBefore.mixin($pos, $radius, $height, $angle, $border-width, $bg-color);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&--bottom::before {
|
|
106
|
+
@include arrowBottomBefore.mixin($pos, $radius, $height, $angle, $border-width, $bg-color);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&--left::before {
|
|
110
|
+
@include arrowLeftBefore.mixin($pos, $radius, $height, $angle, $border-width, $bg-color);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
&--right::before {
|
|
114
|
+
@include arrowRightBefore.mixin($pos, $radius, $height, $angle, $border-width, $bg-color);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@function border-image($pos, $offset, $height, $radius, $border-width, $bg-color) {
|
|
2
|
+
@return conic-gradient($bg-color 0 0) fill 0 / ($radius max($border-width, 100% - $pos - $offset) 0 max($border-width, $pos - $offset)) / 0 0 $height 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function clip-path($pos, $offset, $height, $border-width, $angle) {
|
|
6
|
+
@return polygon(
|
|
7
|
+
0 100%,
|
|
8
|
+
0 0,
|
|
9
|
+
100% 0,
|
|
10
|
+
100% 100%,
|
|
11
|
+
min(100% - $border-width, $pos + $offset - $border-width * tan(45deg - $angle / 4)) calc(100% - $border-width),
|
|
12
|
+
$pos calc(100% + $height - $border-width / sin($angle / 2)),
|
|
13
|
+
max($border-width, $pos - $offset + $border-width * tan(45deg - $angle / 4)) calc(100% - $border-width)
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-width, $bg-color) {
|
|
18
|
+
$offset: $height * tan($angle / 2);
|
|
19
|
+
|
|
20
|
+
clip-path: clip-path($pos, $offset, $height, $border-width, $angle);
|
|
21
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-width, $bg-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@function border-radius($pos, $radius, $offset) {
|
|
2
|
+
@return $radius $radius min($radius, 100% - $pos - $offset) min($radius, $pos - $offset) / $radius;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function border-image($pos, $offset, $height, $radius, $border-color) {
|
|
6
|
+
@return conic-gradient($border-color 0 0) fill 0 / ($radius max(0%, 100% - $pos - $offset) 0) max(0%, $pos - $offset) / 0 0 $height 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function clip-path($pos, $offset, $height) {
|
|
10
|
+
@return polygon(0 100%, 0 0, 100% 0, 100% 100%, min(100%, $pos + $offset) 100%, $pos calc(100% + $height), max(0%, $pos - $offset) 100%);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-color) {
|
|
14
|
+
$offset: $height * tan($angle / 2);
|
|
15
|
+
|
|
16
|
+
border-radius: border-radius($pos, $offset, $angle);
|
|
17
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-color);
|
|
18
|
+
clip-path: clip-path($pos, $offset, $height);
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@function border-image($pos, $offset, $height, $radius, $border-width, $bg-color) {
|
|
2
|
+
@return conic-gradient($bg-color 0 0) fill 0 / max($border-width, $pos - $offset) $radius max($border-width, 100% - $pos - $offset) 0 / 0 0 0 $height;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function clip-path($pos, $offset, $height, $border-width, $angle) {
|
|
6
|
+
@return polygon(
|
|
7
|
+
0 0,
|
|
8
|
+
100% 0,
|
|
9
|
+
100% 100%,
|
|
10
|
+
0 100%,
|
|
11
|
+
$border-width min(100% - $border-width, $pos + $offset - $border-width * tan(45deg - $angle / 4)),
|
|
12
|
+
calc($border-width / sin($angle / 2) - $height) $pos,
|
|
13
|
+
$border-width max($border-width, $pos - $offset + $border-width * tan(45deg - $angle / 4))
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-width, $bg-color) {
|
|
18
|
+
$offset: $height * tan($angle / 2);
|
|
19
|
+
|
|
20
|
+
clip-path: clip-path($pos, $offset, $height, $border-width, $angle);
|
|
21
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-width, $bg-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@function border-radius($pos, $radius, $offset) {
|
|
2
|
+
@return $radius / min($radius, $pos - $offset) $radius $radius min($radius, 100% - $pos - $offset);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function border-image($pos, $offset, $height, $radius, $border-color) {
|
|
6
|
+
@return conic-gradient($border-color 0 0) fill 0 / max(0%, $pos - $offset) $radius max(0%, 100% - $pos - $offset) 0 / 0 0 0 $height;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function clip-path($pos, $offset, $height) {
|
|
10
|
+
@return polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 min(100%, $pos + $offset), calc(-1 * $height) $pos, 0 max(0%, $pos - $offset));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-color) {
|
|
14
|
+
$offset: $height * tan($angle / 2);
|
|
15
|
+
|
|
16
|
+
border-radius: border-radius($pos, $offset, $angle);
|
|
17
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-color);
|
|
18
|
+
clip-path: clip-path($pos, $offset, $height);
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@function border-image($pos, $offset, $height, $radius, $border-width, $bg-color) {
|
|
2
|
+
@return conic-gradient($bg-color 0 0) fill 0 / (max($border-width, $pos - $offset) 0 max($border-width, 100% - $pos - $offset) $radius) / 0 $height 0 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function clip-path($pos, $offset, $height, $border-width, $angle) {
|
|
6
|
+
@return polygon(
|
|
7
|
+
100% 0,
|
|
8
|
+
0 0,
|
|
9
|
+
0 100%,
|
|
10
|
+
100% 100%,
|
|
11
|
+
calc(100% - $border-width) min(100% - $border-width, $pos + $offset - $border-width * tan(45deg - $angle / 4)),
|
|
12
|
+
calc(100% + $height - $border-width / sin($angle / 2)) $pos,
|
|
13
|
+
calc(100% - $border-width) max($border-width, $pos - $offset + $border-width * tan(45deg - $angle / 4))
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-width, $bg-color) {
|
|
18
|
+
$offset: $height * tan($angle / 2);
|
|
19
|
+
|
|
20
|
+
clip-path: clip-path($pos, $offset, $height, $border-width, $angle);
|
|
21
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-width, $bg-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@function border-radius($pos, $radius, $offset) {
|
|
2
|
+
@return $radius / ($radius min($radius, $pos - $offset) min($radius, 100% - $pos - $offset) $radius);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function border-image($pos, $offset, $height, $radius, $border-color) {
|
|
6
|
+
@return conic-gradient($border-color 0 0) fill 0 / (max(0%, $pos - $offset) 0 max(0%, 100% - $pos - $offset) $radius) / 0 $height 0 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function clip-path($pos, $offset, $height) {
|
|
10
|
+
@return polygon(100% 0, 0 0, 0 100%, 100% 100%, 100% min(100%, $pos + $offset), calc(100% + $height) $pos, 100% max(0%, $pos - $offset));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-color) {
|
|
14
|
+
$offset: $height * tan($angle / 2);
|
|
15
|
+
|
|
16
|
+
border-radius: border-radius($pos, $offset, $angle);
|
|
17
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-color);
|
|
18
|
+
clip-path: clip-path($pos, $offset, $height);
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@function border-image($pos, $offset, $height, $radius, $border-width, $bg-color) {
|
|
2
|
+
@return conic-gradient($bg-color 0 0) fill 0 / 0 max($border-width, 100% - $pos - $offset) $radius max($border-width, $pos - $offset) / $height 0 0 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function clip-path($pos, $offset, $height, $border-width, $angle) {
|
|
6
|
+
@return polygon(
|
|
7
|
+
0 0,
|
|
8
|
+
0 100%,
|
|
9
|
+
100% 100%,
|
|
10
|
+
100% 0,
|
|
11
|
+
min(100% - $border-width, $pos + $offset - $border-width * tan(45deg - $angle / 4)) $border-width,
|
|
12
|
+
$pos calc($border-width / sin($angle / 2) - $height),
|
|
13
|
+
max($border-width, $pos - $offset + $border-width * tan(45deg - $angle / 4)) $border-width
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-width, $bg-color) {
|
|
18
|
+
$offset: $height * tan($angle / 2);
|
|
19
|
+
|
|
20
|
+
clip-path: clip-path($pos, $offset, $height, $border-width, $angle);
|
|
21
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-width, $bg-color);
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@function border-radius($pos, $radius, $offset) {
|
|
2
|
+
@return (min($radius, $pos - $offset) min($radius, 100% - $pos - $offset) $radius $radius) / $radius;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@function border-image($pos, $offset, $height, $radius, $border-color) {
|
|
6
|
+
@return conic-gradient($border-color 0 0) fill 0 / 0 max(0%, 100% - $pos - $offset) $radius max(0%, $pos - $offset) / $height 0 0 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@function clip-path($pos, $offset, $height) {
|
|
10
|
+
@return polygon(0 0, 0 100%, 100% 100%, 100% 0, min(100%, $pos + $offset) 0, $pos calc(-1 * $height), max(0%, $pos - $offset) 0);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@mixin mixin($pos, $radius, $height, $angle, $border-color) {
|
|
14
|
+
$offset: $height * tan($angle / 2);
|
|
15
|
+
|
|
16
|
+
border-radius: border-radius($pos, $offset, $angle);
|
|
17
|
+
border-image: border-image($pos, $offset, $height, $radius, $border-color);
|
|
18
|
+
clip-path: clip-path($pos, $offset, $height);
|
|
19
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const stylelint = require("stylelint");
|
|
2
|
+
const deprecatedVariables = require("@fkui/css-variables/dist/deprecated-variables.json");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef { import("postcss").Root } Root
|
|
6
|
+
* @typedef { import("postcss").ChildNode } ChildNode
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {Object} Variable
|
|
11
|
+
* @property {string} name
|
|
12
|
+
* @property {number} offset
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const ruleName = "fkui/deprecated-variable";
|
|
16
|
+
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
17
|
+
deprecated: (selector) => `Deprecated variable "${selector}"`,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param node {ChildNode }
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
24
|
+
function isDeclaration(node) {
|
|
25
|
+
return node.type === "decl";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param variable {Variable}
|
|
30
|
+
* @returns {boolean}
|
|
31
|
+
*/
|
|
32
|
+
function isDeprecated(variable) {
|
|
33
|
+
return deprecatedVariables.includes(variable.name);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @param node {ChildNode }
|
|
38
|
+
* @returns {IterableIterator<Variable>}
|
|
39
|
+
*/
|
|
40
|
+
function* extractVariables(node) {
|
|
41
|
+
const { value } = node;
|
|
42
|
+
for (const match of value.matchAll(
|
|
43
|
+
/var\(\s*(.+?)\s*(?:,\s*[^)]*\s*)?\)/g,
|
|
44
|
+
)) {
|
|
45
|
+
yield {
|
|
46
|
+
name: match[1],
|
|
47
|
+
offset: match.index,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function rule(actual) {
|
|
53
|
+
/**
|
|
54
|
+
* @param {Root} root
|
|
55
|
+
*/
|
|
56
|
+
function deprecatedVariable(root, result) {
|
|
57
|
+
const validOptions = stylelint.utils.validateOptions(result, ruleName, {
|
|
58
|
+
actual,
|
|
59
|
+
});
|
|
60
|
+
if (!validOptions) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
root.walk(
|
|
65
|
+
/**
|
|
66
|
+
* @param {ChildNode} node
|
|
67
|
+
*/
|
|
68
|
+
(node) => {
|
|
69
|
+
if (!isDeclaration(node)) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
for (const variable of extractVariables(node)) {
|
|
74
|
+
if (isDeprecated(variable)) {
|
|
75
|
+
stylelint.utils.report({
|
|
76
|
+
index: 0,
|
|
77
|
+
message: messages.deprecated(variable.name),
|
|
78
|
+
node,
|
|
79
|
+
ruleName,
|
|
80
|
+
result,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return deprecatedVariable;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
module.exports = stylelint.createPlugin(ruleName, rule);
|
|
92
|
+
module.exports.ruleName = ruleName;
|
|
93
|
+
module.exports.messages = messages;
|