@agnos-ui/core-bootstrap 0.9.1 → 0.9.2
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/css/agnosui.css +10 -11
- package/css/agnosui.css.map +1 -1
- package/css/slider.css +2 -0
- package/css/slider.css.map +1 -1
- package/css/tree.css +8 -11
- package/css/tree.css.map +1 -1
- package/package.json +2 -2
- package/scss/_variables.scss +1 -2
- package/scss/slider.scss +3 -0
- package/scss/tree.scss +10 -5
- package/scss/_functions.scss +0 -36
package/css/agnosui.css
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility function to replace a substring as Sass doesn't provide the built-in method to do it
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Method implementation taken from Bootstrap
|
|
6
|
-
* ref: https://github.com/twbs/bootstrap/blob/cacbdc680ecdfee5f0c7fbb876ad15188eaf697d/scss/_functions.scss#L131
|
|
7
|
-
*/
|
|
8
1
|
.au-tree {
|
|
9
2
|
--bs-tree-item-padding-start: 2.25rem;
|
|
10
3
|
--bs-tree-expand-icon-margin-inline-end: 0.5rem;
|
|
@@ -13,8 +6,8 @@
|
|
|
13
6
|
--bs-tree-expand-icon-background-color-hover: var(--bs-blue-100, #cfe2ff);
|
|
14
7
|
--bs-tree-expand-icon-width: 2.25rem;
|
|
15
8
|
--bs-tree-expand-icon-height: 2.25rem;
|
|
16
|
-
--bs-tree-expand-icon:
|
|
17
|
-
--bs-tree-expand-icon-hover:
|
|
9
|
+
--bs-tree-expand-icon-color: #0d6efd;
|
|
10
|
+
--bs-tree-expand-icon-color-hover: #052c65;
|
|
18
11
|
list-style: none;
|
|
19
12
|
padding: 0;
|
|
20
13
|
margin: 0;
|
|
@@ -54,13 +47,17 @@
|
|
|
54
47
|
cursor: pointer;
|
|
55
48
|
}
|
|
56
49
|
.au-tree .au-tree-expand-icon:hover {
|
|
57
|
-
--bs-tree-expand-icon: var(--bs-tree-expand-icon-hover);
|
|
58
50
|
--bs-tree-expand-icon-background-color: var(--bs-tree-expand-icon-background-color-hover);
|
|
59
51
|
}
|
|
52
|
+
.au-tree .au-tree-expand-icon:hover .au-tree-expand-icon-svg .au-tree-expand-icon-svg-fill {
|
|
53
|
+
stroke: var(--bs-tree-expand-icon-color-hover);
|
|
54
|
+
}
|
|
60
55
|
.au-tree .au-tree-expand-icon .au-tree-expand-icon-svg {
|
|
61
|
-
content: var(--bs-tree-expand-icon);
|
|
62
56
|
transition: transform 0.3s;
|
|
63
57
|
}
|
|
58
|
+
.au-tree .au-tree-expand-icon .au-tree-expand-icon-svg .au-tree-expand-icon-svg-fill {
|
|
59
|
+
stroke: var(--bs-tree-expand-icon-color);
|
|
60
|
+
}
|
|
64
61
|
.au-tree .au-tree-expand-icon.au-tree-expand-icon-expanded .au-tree-expand-icon-svg {
|
|
65
62
|
transform: rotate(90deg);
|
|
66
63
|
}
|
|
@@ -127,6 +124,7 @@
|
|
|
127
124
|
--bs-slider-clickable-area-vertical-translate: translateX(-50%);
|
|
128
125
|
--bs-slider-clickable-area-vertical-flex-shrink: 0;
|
|
129
126
|
--bs-slider-clickable-area-cursor: pointer;
|
|
127
|
+
--bs-slider-disabled-background-color: var(--bs-secondary-bg, #e9ecef);
|
|
130
128
|
--bs-slider-disabled-color: var(--bs-dark-bg-subtle, #ced4da);
|
|
131
129
|
--bs-slider-disabled-cursor: not-allowed;
|
|
132
130
|
height: 100%;
|
|
@@ -355,6 +353,7 @@
|
|
|
355
353
|
}
|
|
356
354
|
.au-slider .au-slider-content.disabled {
|
|
357
355
|
cursor: var(--bs-slider-disabled-cursor);
|
|
356
|
+
background-color: var(--bs-slider-disabled-background-color);
|
|
358
357
|
}
|
|
359
358
|
.au-slider .au-slider-content.disabled .au-slider-label,
|
|
360
359
|
.au-slider .au-slider-content.disabled .au-slider-label-vertical,
|
package/css/agnosui.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/tree.scss","../scss/select.scss","../scss/slider.scss","../scss/rating.scss","../scss/carousel.scss","../scss/toaster.scss"],"names":[],"mappings":"AAEA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;;AAEA;EACC;;AAIF;EACC;;AAEA;EACC;;AAKD;EACC;;;ACzEJ;EACC;;;AAID;EACC;EACA;EACA;;;ACiBD;EAEC;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;;AAEA;EACC;;AAGD;EACC;;AAGD;EApGA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AA6FA;EA/GA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AAwGA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;;AAED;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;;AAED;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AACA;EACC;;AAGF;EACC;;AAIF;EACC;EACA;EACA;EACA;;AAGA;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAEA;EACC;;AAKD;EACC;EACA;EACA;;AAEA;EACC;;AAIF;EACC;;AAOL;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAIF;EACC;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIF;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAEA;AAAA;AAAA;AAAA;EAIC;;AAED;AAAA;EAEC;EACA;;AAED;AAAA;AAAA;EAGC;;;AC7WH;EACC;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;ACdF;EACC;;;AAGD;EACC;EACA;;;AAGD;EACC;EACA;EACA;;;ACZD;EACC;;;AAGD;EACC","file":"agnosui.css"}
|
package/css/slider.css
CHANGED
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
--bs-slider-clickable-area-vertical-translate: translateX(-50%);
|
|
51
51
|
--bs-slider-clickable-area-vertical-flex-shrink: 0;
|
|
52
52
|
--bs-slider-clickable-area-cursor: pointer;
|
|
53
|
+
--bs-slider-disabled-background-color: var(--bs-secondary-bg, #e9ecef);
|
|
53
54
|
--bs-slider-disabled-color: var(--bs-dark-bg-subtle, #ced4da);
|
|
54
55
|
--bs-slider-disabled-cursor: not-allowed;
|
|
55
56
|
height: 100%;
|
|
@@ -278,6 +279,7 @@
|
|
|
278
279
|
}
|
|
279
280
|
.au-slider .au-slider-content.disabled {
|
|
280
281
|
cursor: var(--bs-slider-disabled-cursor);
|
|
282
|
+
background-color: var(--bs-slider-disabled-background-color);
|
|
281
283
|
}
|
|
282
284
|
.au-slider .au-slider-content.disabled .au-slider-label,
|
|
283
285
|
.au-slider .au-slider-content.disabled .au-slider-label-vertical,
|
package/css/slider.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/slider.scss"],"names":[],"mappings":"AA2BA;EAEC;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAGA;;AAEA;EACC;;AAGD;EACC;;AAGD;
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/slider.scss"],"names":[],"mappings":"AA2BA;EAEC;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EAEA;EACA;EACA;EACA;EAEA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EAEA;EACA;EACA;EAGA;;AAEA;EACC;;AAGD;EACC;;AAGD;EApGA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AA6FA;EA/GA;EACA;EAEA;EAEA;EACA;EACA;EACA;EAEA;EACA;EACA;EAEA;EAEA;EACA;EACA;;AAwGA;EACC;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;;AAED;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;;AACA;EACC;;AAED;EACC;EACA;;AAED;EACC;EACA;;AAIF;EACC;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;;AACA;EACC;;AAGF;EACC;;AAIF;EACC;EACA;EACA;EACA;;AAGA;EACC;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAEA;EACC;EACA;EACA;;AAEA;EACC;;AAKD;EACC;EACA;EACA;;AAEA;EACC;;AAIF;EACC;;AAOL;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;EACA;EACA;;AAEA;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;;AAGD;EACC;EACA;;AAGD;EACC;;AAIF;EACC;EACA;EACA;;AAEA;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;;AAGD;EACC;;AAIF;EACC;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;;AAGD;EACC;EACA;;AAEA;AAAA;AAAA;AAAA;EAIC;;AAED;AAAA;EAEC;EACA;;AAED;AAAA;AAAA;EAGC","file":"slider.css"}
|
package/css/tree.css
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility function to replace a substring as Sass doesn't provide the built-in method to do it
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Method implementation taken from Bootstrap
|
|
6
|
-
* ref: https://github.com/twbs/bootstrap/blob/cacbdc680ecdfee5f0c7fbb876ad15188eaf697d/scss/_functions.scss#L131
|
|
7
|
-
*/
|
|
8
1
|
.au-tree {
|
|
9
2
|
--bs-tree-item-padding-start: 2.25rem;
|
|
10
3
|
--bs-tree-expand-icon-margin-inline-end: 0.5rem;
|
|
@@ -13,8 +6,8 @@
|
|
|
13
6
|
--bs-tree-expand-icon-background-color-hover: var(--bs-blue-100, #cfe2ff);
|
|
14
7
|
--bs-tree-expand-icon-width: 2.25rem;
|
|
15
8
|
--bs-tree-expand-icon-height: 2.25rem;
|
|
16
|
-
--bs-tree-expand-icon:
|
|
17
|
-
--bs-tree-expand-icon-hover:
|
|
9
|
+
--bs-tree-expand-icon-color: #0d6efd;
|
|
10
|
+
--bs-tree-expand-icon-color-hover: #052c65;
|
|
18
11
|
list-style: none;
|
|
19
12
|
padding: 0;
|
|
20
13
|
margin: 0;
|
|
@@ -54,13 +47,17 @@
|
|
|
54
47
|
cursor: pointer;
|
|
55
48
|
}
|
|
56
49
|
.au-tree .au-tree-expand-icon:hover {
|
|
57
|
-
--bs-tree-expand-icon: var(--bs-tree-expand-icon-hover);
|
|
58
50
|
--bs-tree-expand-icon-background-color: var(--bs-tree-expand-icon-background-color-hover);
|
|
59
51
|
}
|
|
52
|
+
.au-tree .au-tree-expand-icon:hover .au-tree-expand-icon-svg .au-tree-expand-icon-svg-fill {
|
|
53
|
+
stroke: var(--bs-tree-expand-icon-color-hover);
|
|
54
|
+
}
|
|
60
55
|
.au-tree .au-tree-expand-icon .au-tree-expand-icon-svg {
|
|
61
|
-
content: var(--bs-tree-expand-icon);
|
|
62
56
|
transition: transform 0.3s;
|
|
63
57
|
}
|
|
58
|
+
.au-tree .au-tree-expand-icon .au-tree-expand-icon-svg .au-tree-expand-icon-svg-fill {
|
|
59
|
+
stroke: var(--bs-tree-expand-icon-color);
|
|
60
|
+
}
|
|
64
61
|
.au-tree .au-tree-expand-icon.au-tree-expand-icon-expanded .au-tree-expand-icon-svg {
|
|
65
62
|
transform: rotate(90deg);
|
|
66
63
|
}
|
package/css/tree.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["../scss/
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../scss/tree.scss"],"names":[],"mappings":"AAEA;EAEC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;;AAEA;EACC;EACA;EACA;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;EACA;;AAGD;EACC;EACA;;AAGD;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;AAEA;EACC;;AAEA;EACC;;AAIF;EACC;;AAEA;EACC;;AAKD;EACC","file":"tree.css"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/core-bootstrap",
|
|
3
3
|
"description": "Styles and component interface extensions necessary to use AgnosUI with Bootstrap.",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.2",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bootstrap",
|
|
7
7
|
"css",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@agnos-ui/core": "0.9.
|
|
65
|
+
"@agnos-ui/core": "0.9.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@amadeus-it-group/tansu": "^2.0.0"
|
package/scss/_variables.scss
CHANGED
|
@@ -70,6 +70,7 @@ $au-slider-clickable-area-main-size: 1.5rem !default;
|
|
|
70
70
|
$au-slider-clickable-area-secondary-size: 100% !default;
|
|
71
71
|
$au-slider-clickable-area-vertical-flex-shrink: 0 !default;
|
|
72
72
|
$au-slider-clickable-area-cursor: pointer !default;
|
|
73
|
+
$au-slider-disabled-background-color: $au-slider-color-background !default;
|
|
73
74
|
$au-slider-disabled-color: var(--#{$prefix}dark-bg-subtle, #ced4da) !default;
|
|
74
75
|
$au-slider-disabled-cursor: not-allowed !default;
|
|
75
76
|
|
|
@@ -99,6 +100,4 @@ $au-tree-expand-icon-width: 2.25rem;
|
|
|
99
100
|
$au-tree-expand-icon-height: 2.25rem;
|
|
100
101
|
$au-tree-expand-icon-color: #0d6efd !default;
|
|
101
102
|
$au-tree-expand-icon-color-hover: #052c65 !default;
|
|
102
|
-
$au-tree-expand-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M3 1 L7 5 L3 9" stroke="#{$au-tree-expand-icon-color}" stroke-width="1" fill="none"/></svg>') !default;
|
|
103
|
-
$au-tree-expand-icon-hover: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 10 10"><path d="M3 1 L7 5 L3 9" stroke="#{$au-tree-expand-icon-color-hover}" stroke-width="1" fill="none"/></svg>') !default;
|
|
104
103
|
// scss-docs-end tree-vars
|
package/scss/slider.scss
CHANGED
|
@@ -89,6 +89,7 @@
|
|
|
89
89
|
--#{variables.$prefix}slider-clickable-area-vertical-flex-shrink: #{variables.$au-slider-clickable-area-vertical-flex-shrink};
|
|
90
90
|
--#{variables.$prefix}slider-clickable-area-cursor: #{variables.$au-slider-clickable-area-cursor};
|
|
91
91
|
|
|
92
|
+
--#{variables.$prefix}slider-disabled-background-color: #{variables.$au-slider-disabled-background-color};
|
|
92
93
|
--#{variables.$prefix}slider-disabled-color: #{variables.$au-slider-disabled-color};
|
|
93
94
|
--#{variables.$prefix}slider-disabled-cursor: #{variables.$au-slider-disabled-cursor};
|
|
94
95
|
// scss-docs-end slider-css-vars
|
|
@@ -347,6 +348,8 @@
|
|
|
347
348
|
|
|
348
349
|
&.disabled {
|
|
349
350
|
cursor: var(--#{variables.$prefix}slider-disabled-cursor);
|
|
351
|
+
background-color: var(--#{variables.$prefix}slider-disabled-background-color);
|
|
352
|
+
|
|
350
353
|
.au-slider-label,
|
|
351
354
|
.au-slider-label-vertical,
|
|
352
355
|
.au-slider-tick-label,
|
package/scss/tree.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
@use 'variables';
|
|
2
|
-
@use '_functions';
|
|
3
2
|
|
|
4
3
|
.au-tree {
|
|
5
4
|
// scss-docs-start tree-css-vars
|
|
@@ -10,8 +9,8 @@
|
|
|
10
9
|
--#{variables.$prefix}tree-expand-icon-background-color-hover: #{variables.$au-tree-expand-icon-background-color-hover};
|
|
11
10
|
--#{variables.$prefix}tree-expand-icon-width: #{variables.$au-tree-expand-icon-width};
|
|
12
11
|
--#{variables.$prefix}tree-expand-icon-height: #{variables.$au-tree-expand-icon-height};
|
|
13
|
-
--#{variables.$prefix}tree-expand-icon: #{
|
|
14
|
-
--#{variables.$prefix}tree-expand-icon-hover: #{
|
|
12
|
+
--#{variables.$prefix}tree-expand-icon-color: #{variables.$au-tree-expand-icon-color};
|
|
13
|
+
--#{variables.$prefix}tree-expand-icon-color-hover: #{variables.$au-tree-expand-icon-color-hover};
|
|
15
14
|
// scss-docs-end tree-css-vars
|
|
16
15
|
|
|
17
16
|
list-style: none;
|
|
@@ -57,13 +56,19 @@
|
|
|
57
56
|
cursor: pointer;
|
|
58
57
|
|
|
59
58
|
&:hover {
|
|
60
|
-
--#{variables.$prefix}tree-expand-icon: var(--#{variables.$prefix}tree-expand-icon-hover);
|
|
61
59
|
--#{variables.$prefix}tree-expand-icon-background-color: var(--#{variables.$prefix}tree-expand-icon-background-color-hover);
|
|
60
|
+
|
|
61
|
+
.au-tree-expand-icon-svg .au-tree-expand-icon-svg-fill {
|
|
62
|
+
stroke: var(--#{variables.$prefix}tree-expand-icon-color-hover);
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
.au-tree-expand-icon-svg {
|
|
65
|
-
content: var(--#{variables.$prefix}tree-expand-icon);
|
|
66
67
|
transition: transform 0.3s;
|
|
68
|
+
|
|
69
|
+
.au-tree-expand-icon-svg-fill {
|
|
70
|
+
stroke: var(--#{variables.$prefix}tree-expand-icon-color);
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
&.au-tree-expand-icon-expanded {
|
package/scss/_functions.scss
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
@use 'sass:string';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Utility function to replace a substring as Sass doesn't provide the built-in method to do it
|
|
5
|
-
*/
|
|
6
|
-
@function str-replace($string, $search, $replace: '') {
|
|
7
|
-
$index: string.index($string, $search);
|
|
8
|
-
|
|
9
|
-
@if $index {
|
|
10
|
-
@return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + string.length($search)), $search, $replace);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
@return $string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Characters which are escaped by the escape-svg function
|
|
17
|
-
$escaped-characters: (('<', '%3c'), ('>', '%3e'), ('#', '%23'), ('(', '%28'), (')', '%29')) !default;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Method implementation taken from Bootstrap
|
|
21
|
-
* ref: https://github.com/twbs/bootstrap/blob/cacbdc680ecdfee5f0c7fbb876ad15188eaf697d/scss/_functions.scss#L131
|
|
22
|
-
*/
|
|
23
|
-
@function escape-svg($string) {
|
|
24
|
-
@if string.index($string, 'data:image/svg+xml') {
|
|
25
|
-
@each $char, $encoded in $escaped-characters {
|
|
26
|
-
// Do not escape the url brackets
|
|
27
|
-
@if string.index($string, 'url(') == 1 {
|
|
28
|
-
$string: url('#{str-replace(string.slice($string, 6, -3), $char, $encoded)}');
|
|
29
|
-
} @else {
|
|
30
|
-
$string: str-replace($string, $char, $encoded);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@return $string;
|
|
36
|
-
}
|