uniform-ui 3.0.0.beta8 → 3.0.0.beta10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assets/javascripts/uniform/checkbox.js +12 -12
- data/lib/assets/javascripts/uniform/component.js +17 -13
- data/lib/assets/javascripts/uniform/dropdown.js +54 -54
- data/lib/assets/javascripts/uniform/dropzone.js +107 -0
- data/lib/assets/javascripts/uniform/floating-label-input.js +8 -8
- data/lib/assets/javascripts/uniform/modal.js +12 -12
- data/lib/assets/javascripts/uniform/popover.js +54 -33
- data/lib/assets/javascripts/uniform/resizer.js +20 -20
- data/lib/assets/javascripts/uniform/select.js +186 -162
- data/lib/assets/javascripts/uniform/sticker.js +26 -0
- data/lib/assets/javascripts/uniform/tooltip.js +29 -16
- data/lib/assets/javascripts/uniform.js +12 -10
- data/lib/assets/stylesheets/uniform/base.scss +20 -5
- data/lib/assets/stylesheets/uniform/components/buttons.scss +4 -5
- data/lib/assets/stylesheets/uniform/components/checkbox.scss +2 -0
- data/lib/assets/stylesheets/uniform/components/container.scss +8 -7
- data/lib/assets/stylesheets/uniform/components/dropzone.scss +40 -0
- data/lib/assets/stylesheets/uniform/components/pointer.scss +4 -4
- data/lib/assets/stylesheets/uniform/components/select.scss +7 -2
- data/lib/assets/stylesheets/uniform/components/thumb.scss +0 -1
- data/lib/assets/stylesheets/uniform/components/z-input.scss +1 -1
- data/lib/assets/stylesheets/uniform/config.scss +156 -0
- data/lib/assets/stylesheets/uniform/defaults.scss +2 -23
- data/lib/assets/stylesheets/uniform/functions/icons.scss +29 -0
- data/lib/assets/stylesheets/uniform/functions/map.scss +95 -0
- data/lib/assets/stylesheets/uniform/functions/string.scss +15 -0
- data/lib/assets/stylesheets/uniform/functions.scss +4 -79
- data/lib/assets/stylesheets/uniform/mixins.scss +34 -26
- data/lib/assets/stylesheets/uniform/utilities/effects.scss +31 -0
- data/lib/assets/stylesheets/uniform/utilities/layout.scss +13 -20
- data/lib/assets/stylesheets/uniform/utilities/position.scss +4 -0
- data/lib/assets/stylesheets/uniform/utilities/text.scss +1 -0
- data/lib/assets/stylesheets/uniform/utilities.scss +6 -0
- data/lib/uniform/version.rb +1 -1
- metadata +9 -3
- data/lib/assets/stylesheets/uniform/variables.scss +0 -145
@@ -7,14 +7,15 @@
|
|
7
7
|
padding-right: 1em;
|
8
8
|
}
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
// TODO match this with breakpoints variable, so that breakpoints can change and adjust this
|
11
|
+
.container{
|
12
|
+
@include breakpoint('md'){
|
13
|
+
max-width: 720px;
|
14
|
+
}
|
15
|
+
@include breakpoint('lg'){
|
12
16
|
max-width: 1080px;
|
13
17
|
}
|
14
|
-
|
15
|
-
|
16
|
-
@include breakpoint('xl'){
|
17
|
-
.container{
|
18
|
-
max-width: 1440px;
|
18
|
+
@include breakpoint('xl'){
|
19
|
+
max-width: 1400px;
|
19
20
|
}
|
20
21
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
.uniformDropzone {
|
2
|
+
&:before {
|
3
|
+
display: none;
|
4
|
+
content: '';
|
5
|
+
position:absolute;
|
6
|
+
top: 0;
|
7
|
+
bottom: 0;
|
8
|
+
left: 0;
|
9
|
+
right: 0;
|
10
|
+
text-align:center;
|
11
|
+
border: 2px dashed color('blue-50');
|
12
|
+
background: rgba(white, 0.5);
|
13
|
+
color: color('blue-50');
|
14
|
+
z-index:98;
|
15
|
+
backdrop-filter: blur(2px);
|
16
|
+
}
|
17
|
+
&:after {
|
18
|
+
display: none;
|
19
|
+
position:absolute;
|
20
|
+
left:50%;
|
21
|
+
top:50%;
|
22
|
+
transform: translate(-50%, -50%);
|
23
|
+
content: 'Drag Here';
|
24
|
+
z-index:99;
|
25
|
+
font-weight: bold;
|
26
|
+
font-size: 1.2em;
|
27
|
+
}
|
28
|
+
&.-show {
|
29
|
+
&:before {display: block;}
|
30
|
+
&:after {display: block;}
|
31
|
+
}
|
32
|
+
&.-active {
|
33
|
+
&:before {
|
34
|
+
background: rgba(color('blue'), 0.3);
|
35
|
+
}
|
36
|
+
&:after {
|
37
|
+
color: color('blue-70');
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
@@ -42,8 +42,8 @@
|
|
42
42
|
}
|
43
43
|
&:before {
|
44
44
|
margin-left: 0;
|
45
|
-
margin-top: -
|
46
|
-
height:
|
45
|
+
margin-top: -10px;
|
46
|
+
height: 20px;
|
47
47
|
width: 2px;
|
48
48
|
top: 50%;
|
49
49
|
right: 0;
|
@@ -60,8 +60,8 @@
|
|
60
60
|
}
|
61
61
|
&:before {
|
62
62
|
margin-left: 0;
|
63
|
-
margin-top: -
|
64
|
-
height:
|
63
|
+
margin-top: -10px;
|
64
|
+
height: 20px;
|
65
65
|
width: 2px;
|
66
66
|
left: 0;
|
67
67
|
top: 50%;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
@import 'uniform/functions/icons';
|
2
|
+
|
1
3
|
.uniformSelect{
|
2
4
|
--border-color: #{red(color('gray-40'))}, #{green(color('gray-40'))}, #{blue(color('gray-40'))};
|
3
5
|
appearance: none;
|
@@ -38,6 +40,7 @@
|
|
38
40
|
.uniformSelect-value{
|
39
41
|
z-index: 2;
|
40
42
|
text-align: left;
|
43
|
+
display:flex;
|
41
44
|
}
|
42
45
|
.uniformSelect-indicator{
|
43
46
|
padding-left: 0.25em;
|
@@ -108,7 +111,9 @@
|
|
108
111
|
}
|
109
112
|
}
|
110
113
|
|
111
|
-
|
114
|
+
.uniformSelect-selection + .uniformSelect-selection {
|
115
|
+
margin-left: 0.5em;
|
116
|
+
}
|
112
117
|
|
113
118
|
.uniformSelect-selection{
|
114
119
|
display: inline-flex;
|
@@ -118,7 +123,7 @@
|
|
118
123
|
padding: 0;
|
119
124
|
line-height: 1;
|
120
125
|
padding-left:0.5em;
|
121
|
-
background:
|
126
|
+
background: color('gray-10');
|
122
127
|
border-radius: 0.25em;
|
123
128
|
span{
|
124
129
|
flex: 1 1 auto;
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
select.uniformInput {
|
20
20
|
padding-right: 1em;
|
21
|
-
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
|
21
|
+
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>') no-repeat center right;
|
22
22
|
}
|
23
23
|
|
24
24
|
@include color-rule('.focus') using ($color) {
|
@@ -0,0 +1,156 @@
|
|
1
|
+
@import 'uniform/functions/map';
|
2
|
+
|
3
|
+
$system-font: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
|
4
|
+
|
5
|
+
$uniform_configs: if(variable-exists('uniform_configs'), $uniform_configs, ());
|
6
|
+
$uniform_configs: purge(merge((
|
7
|
+
"base-font": $system-font,
|
8
|
+
"combinators": (),
|
9
|
+
"pseudo_classes": (
|
10
|
+
"hover": hover,
|
11
|
+
),
|
12
|
+
"breakpoints": (
|
13
|
+
'include_containers': false,
|
14
|
+
'sm': "max-width: 719px",
|
15
|
+
'md': "min-width: 720px",
|
16
|
+
'lg': "min-width: 1080px",
|
17
|
+
'xl': "min-width: 1440px"
|
18
|
+
),
|
19
|
+
"colors": (
|
20
|
+
'white': #FFFFFF,
|
21
|
+
'gray': (
|
22
|
+
'spectrum': true,
|
23
|
+
'color': #505152
|
24
|
+
),
|
25
|
+
'green': (
|
26
|
+
'spectrum': true,
|
27
|
+
'color': #97C848
|
28
|
+
),
|
29
|
+
'blue': (
|
30
|
+
'spectrum': true,
|
31
|
+
'color': #0994E2
|
32
|
+
),
|
33
|
+
'red': (
|
34
|
+
'spectrum': true,
|
35
|
+
'color': #E1563E
|
36
|
+
),
|
37
|
+
'yellow': (
|
38
|
+
'spectrum': true,
|
39
|
+
'color': #D7E542
|
40
|
+
),
|
41
|
+
'purple': (
|
42
|
+
'spectrum': true,
|
43
|
+
'color': #9461b9
|
44
|
+
)
|
45
|
+
),
|
46
|
+
"sizes": (
|
47
|
+
'border': (
|
48
|
+
'': 1px,
|
49
|
+
'none': 0,
|
50
|
+
'2px': 2px,
|
51
|
+
'3px': 3px,
|
52
|
+
'4px': 4px
|
53
|
+
),
|
54
|
+
'divide': (
|
55
|
+
'': 1px,
|
56
|
+
'none': 0,
|
57
|
+
'2px': 2px,
|
58
|
+
'3px': 3px,
|
59
|
+
'4px': 4px
|
60
|
+
),
|
61
|
+
'rounded': (
|
62
|
+
'': 0.25rem,
|
63
|
+
'none': 0,
|
64
|
+
"xs": 0.1rem,
|
65
|
+
"sm": 0.2rem,
|
66
|
+
"lg": 0.5rem,
|
67
|
+
"xl": 1rem,
|
68
|
+
),
|
69
|
+
'margin': (
|
70
|
+
'': 1rem,
|
71
|
+
'none': 0,
|
72
|
+
"1\\/4x": 0.25rem,
|
73
|
+
"1\\/2x": 0.5rem,
|
74
|
+
"3\\/4x": 0.75rem,
|
75
|
+
"xs": 0.8rem,
|
76
|
+
"sm": 0.9rem,
|
77
|
+
"lg": 1.2rem,
|
78
|
+
"xl": 1.4rem,
|
79
|
+
"2x": 2rem,
|
80
|
+
),
|
81
|
+
'gap': (
|
82
|
+
'': 1rem,
|
83
|
+
'none': 0,
|
84
|
+
"xs": 0.8rem,
|
85
|
+
"sm": 0.9rem,
|
86
|
+
"lg": 1.2rem,
|
87
|
+
"xl": 1.4rem,
|
88
|
+
),
|
89
|
+
'space': (
|
90
|
+
'': 1rem,
|
91
|
+
'none': 0,
|
92
|
+
"xs": 0.8rem,
|
93
|
+
"sm": 0.9rem,
|
94
|
+
"lg": 1.2rem,
|
95
|
+
"xl": 1.4rem,
|
96
|
+
"2x": 2rem,
|
97
|
+
"4x": 4rem,
|
98
|
+
),
|
99
|
+
'pad': (
|
100
|
+
'' : 1rem,
|
101
|
+
'none' : 0,
|
102
|
+
"1\\/4x" : 0.25rem,
|
103
|
+
"1\\/2x" : 0.5rem,
|
104
|
+
"3\\/4x" : 0.75rem,
|
105
|
+
"xs" : 0.8rem,
|
106
|
+
"sm" : 0.9rem,
|
107
|
+
"lg" : 1.2rem,
|
108
|
+
"xl" : 1.4rem,
|
109
|
+
"2x" : 2rem,
|
110
|
+
),
|
111
|
+
'text': (
|
112
|
+
'': 1rem,
|
113
|
+
"xs" : 0.8rem,
|
114
|
+
"sm" : 0.9rem,
|
115
|
+
"lg" : 1.2rem,
|
116
|
+
"xl" : 1.4rem,
|
117
|
+
"2x" : 2rem,
|
118
|
+
"4x" : 4rem,
|
119
|
+
"8x" : 8rem
|
120
|
+
|
121
|
+
),
|
122
|
+
'stroke': (
|
123
|
+
"sm" : 0.5px,
|
124
|
+
"md" : 1px,
|
125
|
+
"lg" : 1.5px,
|
126
|
+
"2x" : 2px,
|
127
|
+
"3x" : 3px
|
128
|
+
)
|
129
|
+
)
|
130
|
+
), $uniform_configs));
|
131
|
+
|
132
|
+
//----------------------------------------------------------------
|
133
|
+
// Color Variations (ex. gray-30 from gray)
|
134
|
+
//----------------------------------------------------------------
|
135
|
+
$uniform_colors: map-get($uniform_configs, 'colors');
|
136
|
+
@each $name, $color_options in $uniform_colors {
|
137
|
+
@if type-of($color_options) == 'map' {
|
138
|
+
$color: map-get($color_options, 'color');
|
139
|
+
$uniform_colors: map-merge($uniform_colors, ("#{$name}": $color));
|
140
|
+
|
141
|
+
@if map-get($color_options, 'spectrum') {
|
142
|
+
@for $index from 1 through 9 {
|
143
|
+
$saturation_adjustment: 0;
|
144
|
+
@if saturation($color) > 20% {
|
145
|
+
$saturation_adjustment: ((100 - saturation($color)) / 4) * abs(5 - $index);
|
146
|
+
}
|
147
|
+
$uniform_colors: map-merge($uniform_colors, ("#{$name}-#{(10 - $index) * 10}": change-color($color, $lightness: $index * 10, $saturation: saturation($color) + $saturation_adjustment)));
|
148
|
+
}
|
149
|
+
}
|
150
|
+
} @else if (type-of($color_options) == 'color') {
|
151
|
+
$uniform_colors: map-merge($uniform_colors, ("#{$name}": $color_options));
|
152
|
+
} @else {
|
153
|
+
$uniform_colors: map-remove($uniform_colors, $name);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
$uniform_configs: map-merge($uniform_configs, (colors: $uniform_colors));
|
@@ -31,27 +31,6 @@ pre{
|
|
31
31
|
margin: 0;
|
32
32
|
}
|
33
33
|
|
34
|
-
ul,
|
35
|
-
ol,
|
36
|
-
dl{
|
37
|
-
list-style: none;
|
38
|
-
margin: 0;
|
39
|
-
padding: 0;
|
40
|
-
ul,
|
41
|
-
ol,
|
42
|
-
dl{
|
43
|
-
margin-bottom: 0;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
dd{
|
48
|
-
margin-left: 0;
|
49
|
-
margin-bottom: 0.5em;
|
50
|
-
}
|
51
|
-
dt{
|
52
|
-
font-weight: bold;
|
53
|
-
}
|
54
|
-
|
55
34
|
table{
|
56
35
|
background-color: transparent;
|
57
36
|
border-collapse: collapse;
|
@@ -98,8 +77,8 @@ button{
|
|
98
77
|
cursor: pointer;
|
99
78
|
}
|
100
79
|
button{
|
101
|
-
font-family: $base-font;
|
102
|
-
font-size:
|
80
|
+
font-family: map-get($uniform_configs, 'base-font');
|
81
|
+
font-size: 1em;
|
103
82
|
}
|
104
83
|
|
105
84
|
img,
|
@@ -0,0 +1,29 @@
|
|
1
|
+
@import 'uniform/functions/string';
|
2
|
+
|
3
|
+
@function uri-encode($svg) {
|
4
|
+
$encoded: '';
|
5
|
+
$slice: 2000;
|
6
|
+
$index: 0;
|
7
|
+
$loops: ceil(str-length($svg) / $slice);
|
8
|
+
|
9
|
+
@for $i from 1 through $loops {
|
10
|
+
$chunk: str-slice($svg, $index, $index + $slice - 1);
|
11
|
+
$chunk: str-replace($chunk, '"', "'");
|
12
|
+
$chunk: str-replace($chunk, '<', '%3C');
|
13
|
+
$chunk: str-replace($chunk, '>', '%3E');
|
14
|
+
$chunk: str-replace($chunk, '&', '%26');
|
15
|
+
$chunk: str-replace($chunk, '#', '%23');
|
16
|
+
$encoded: #{$encoded}#{$chunk};
|
17
|
+
$index: $index + $slice;
|
18
|
+
}
|
19
|
+
|
20
|
+
@return $encoded;
|
21
|
+
}
|
22
|
+
|
23
|
+
@function svg-encode ($svg) {
|
24
|
+
@return url("data:image/svg+xml;charset=utf8,#{uri-encode($svg)}");
|
25
|
+
}
|
26
|
+
|
27
|
+
@function icon-check($color: #000000){
|
28
|
+
@return svg-encode('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><path d="M28.998 8.531l-2.134-2.134c-0.394-0.393-1.030-0.393-1.423 0l-12.795 12.795-6.086-6.13c-0.393-0.393-1.029-0.393-1.423 0l-2.134 2.134c-0.393 0.394-0.393 1.030 0 1.423l8.924 8.984c0.393 0.393 1.030 0.393 1.423 0l15.648-15.649c0.393-0.392 0.393-1.030 0-1.423z" fill="#{$color}"></path></svg>');
|
29
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
@function get($map, $keys...) {
|
2
|
+
@each $key in $keys {
|
3
|
+
$map: map-get($map, $key);
|
4
|
+
}
|
5
|
+
@return $map;
|
6
|
+
}
|
7
|
+
|
8
|
+
@function set($map, $keys...) {
|
9
|
+
$maps: ($map,);
|
10
|
+
$result: null;
|
11
|
+
|
12
|
+
@if length($keys) == 1 {
|
13
|
+
@error "Not enought key arguments";
|
14
|
+
} @else if length($keys) == 2 {
|
15
|
+
@return map-merge($map, (nth($keys, 1): nth($keys, 2)));
|
16
|
+
}
|
17
|
+
|
18
|
+
@for $i from 1 through length($keys) - 2 {
|
19
|
+
$key: nth($keys, $i);
|
20
|
+
$map: nth($maps, -1);
|
21
|
+
@debug $map;
|
22
|
+
$value: get($map, $key);
|
23
|
+
@if type-of($value) != 'map' {
|
24
|
+
$value: ();
|
25
|
+
}
|
26
|
+
$maps: append($maps, $value);
|
27
|
+
}
|
28
|
+
|
29
|
+
@for $i from length($maps) through 1 {
|
30
|
+
$map: nth($maps, $i);
|
31
|
+
$key: nth($keys, $i);
|
32
|
+
$value: if($i == length($maps), nth($keys, -1), $result);
|
33
|
+
$result: map-merge($map, ($key: $value));
|
34
|
+
}
|
35
|
+
|
36
|
+
@return $result;
|
37
|
+
}
|
38
|
+
|
39
|
+
@function merge($maps...) {
|
40
|
+
$target: ();
|
41
|
+
@each $map in $maps {
|
42
|
+
@each $key, $value in $map {
|
43
|
+
$current: get($target, $key);
|
44
|
+
@if type-of($value) == 'map' and type-of($current) == "map" {
|
45
|
+
$target: set($target, $key, merge($current, $value))
|
46
|
+
} @else {
|
47
|
+
$target: set($target, $key, $value);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
@return $target;
|
52
|
+
}
|
53
|
+
|
54
|
+
@function purge($map) {
|
55
|
+
$target: $map;
|
56
|
+
@each $key, $value in $map {
|
57
|
+
@if type-of($value) == "map" {
|
58
|
+
$target: set($map, $key, purge($value))
|
59
|
+
} @else if $value == false OR $value == "false" {
|
60
|
+
$target: map-remove($map, $key);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
@return $target;
|
64
|
+
}
|
65
|
+
|
66
|
+
@function mapToString($map) {
|
67
|
+
$string: '"';
|
68
|
+
|
69
|
+
@each $key, $value in $map {
|
70
|
+
@if type-of($value) == "string" {
|
71
|
+
$string: str-insert($string, $key, -1);
|
72
|
+
$string: str-insert($string, "/", -1);
|
73
|
+
$string: str-insert($string, $value, -1);
|
74
|
+
$string: str-insert($string, ",", -1);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
$string: str-slice($string, 1, -2);
|
78
|
+
$string: str-insert($string, '"', -1);
|
79
|
+
|
80
|
+
@return $string;
|
81
|
+
}
|
82
|
+
|
83
|
+
@function mapToJSON($map) {
|
84
|
+
$string: '';
|
85
|
+
|
86
|
+
@each $key, $value in $map {
|
87
|
+
@if type-of($value) == "map" {
|
88
|
+
$string: str-insert($string, "\"#{$key}\": #{mapToJSON($value)},", -1);
|
89
|
+
} @else {
|
90
|
+
$string: str-insert($string, "\"#{$key}\": \"#{$value}\",", -1);
|
91
|
+
}
|
92
|
+
}
|
93
|
+
|
94
|
+
@return "{#{str-slice($string, 0, -2)}}";
|
95
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/// Replace `$search` with `$replace` in `$string`
|
2
|
+
/// @author Hugo Giraudel
|
3
|
+
/// @param {String} $string - Initial string
|
4
|
+
/// @param {String} $search - Substring to replace
|
5
|
+
/// @param {String} $replace ('') - New value
|
6
|
+
/// @return {String} - Updated string
|
7
|
+
@function str-replace($string, $search, $replace: '') {
|
8
|
+
$index: str-index($string, $search);
|
9
|
+
|
10
|
+
@if $index {
|
11
|
+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
12
|
+
}
|
13
|
+
|
14
|
+
@return $string;
|
15
|
+
}
|
@@ -1,86 +1,11 @@
|
|
1
|
+
@import 'uniform/functions/map';
|
2
|
+
|
1
3
|
@function toRGB($color){
|
2
4
|
@return red($color), green($color), blue($color);
|
3
5
|
}
|
4
6
|
@function color($key) {
|
5
|
-
@return
|
7
|
+
@return get($uniform_configs, 'colors', $key);
|
6
8
|
}
|
7
9
|
@function size($key) {
|
8
|
-
@return
|
9
|
-
}
|
10
|
-
|
11
|
-
@function mapToString($map) {
|
12
|
-
$string: '"';
|
13
|
-
|
14
|
-
@each $key, $value in $map {
|
15
|
-
$string: str-insert($string, $key, -1);
|
16
|
-
$string: str-insert($string, "/", -1);
|
17
|
-
$string: str-insert($string, $value, -1);
|
18
|
-
$string: str-insert($string, ",", -1);
|
19
|
-
}
|
20
|
-
$string: str-slice($string, 1, -2);
|
21
|
-
$string: str-insert($string, '"', -1);
|
22
|
-
|
23
|
-
@return $string;
|
24
|
-
}
|
25
|
-
|
26
|
-
//----------------------------------------------------------------
|
27
|
-
// Icons
|
28
|
-
//----------------------------------------------------------------
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
/// Replace `$search` with `$replace` in `$string`
|
33
|
-
/// @author Hugo Giraudel
|
34
|
-
/// @param {String} $string - Initial string
|
35
|
-
/// @param {String} $search - Substring to replace
|
36
|
-
/// @param {String} $replace ('') - New value
|
37
|
-
/// @return {String} - Updated string
|
38
|
-
@function str-replace($string, $search, $replace: '') {
|
39
|
-
$index: str-index($string, $search);
|
40
|
-
|
41
|
-
@if $index {
|
42
|
-
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
43
|
-
}
|
44
|
-
|
45
|
-
@return $string;
|
46
|
-
}
|
47
|
-
|
48
|
-
@function uri-encode($svg) {
|
49
|
-
$encoded: '';
|
50
|
-
$slice: 2000;
|
51
|
-
$index: 0;
|
52
|
-
$loops: ceil(str-length($svg) / $slice);
|
53
|
-
|
54
|
-
@for $i from 1 through $loops {
|
55
|
-
$chunk: str-slice($svg, $index, $index + $slice - 1);
|
56
|
-
$chunk: str-replace($chunk, '"', "'");
|
57
|
-
$chunk: str-replace($chunk, '<', '%3C');
|
58
|
-
$chunk: str-replace($chunk, '>', '%3E');
|
59
|
-
$chunk: str-replace($chunk, '&', '%26');
|
60
|
-
$chunk: str-replace($chunk, '#', '%23');
|
61
|
-
$encoded: #{$encoded}#{$chunk};
|
62
|
-
$index: $index + $slice;
|
63
|
-
}
|
64
|
-
|
65
|
-
@return $encoded;
|
66
|
-
}
|
67
|
-
|
68
|
-
@function svg-encode ($svg) {
|
69
|
-
@return url("data:image/svg+xml;charset=utf8,#{uri-encode($svg)}");
|
70
|
-
}
|
71
|
-
|
72
|
-
@function icon-check($color: #000000){
|
73
|
-
@return svg-encode('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" viewBox="0 0 32 32"><path d="M28.998 8.531l-2.134-2.134c-0.394-0.393-1.030-0.393-1.423 0l-12.795 12.795-6.086-6.13c-0.393-0.393-1.029-0.393-1.423 0l-2.134 2.134c-0.393 0.394-0.393 1.030 0 1.423l8.924 8.984c0.393 0.393 1.030 0.393 1.423 0l15.648-15.649c0.393-0.392 0.393-1.030 0-1.423z" fill="#{$color}"></path></svg>');
|
74
|
-
}
|
75
|
-
|
76
|
-
@function icon-x($size: 32, $color: #000000){
|
77
|
-
@return svg-encode('<svg version="1.2" baseProfile="tiny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="#{$size}px" height="#{$size}px" viewBox="0 0 64 64" xml:space="preserve" fill="#{$color}"><g><rect x="-2.352" y="29.385" transform="matrix(0.7071 0.7071 -0.7071 0.7071 32.3545 -14.3899)" width="71.799" height="4.95"/></g><g><rect x="-2.374" y="29.376" transform="matrix(0.7071 -0.7071 0.7071 0.7071 -12.7023 33.0352)" width="71.799" height="4.95"/></g></svg>');
|
78
|
-
}
|
79
|
-
|
80
|
-
@function icon-circle($width: 2, $height: 2, $radius: 1, $color: #000000){
|
81
|
-
@return svg-encode('<svg version="1.0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="#{$width}px" height="#{$height}px" viewBox="0 0 #{$width} #{$height}" enable-background="new 0 0 #{$width} #{$height}" xml:space="preserve"><circle cx="#{$width / 2}" cy="#{$height / 2}" r="#{$radius}" fill="#{$color}"/></svg>');
|
82
|
-
}
|
83
|
-
|
84
|
-
@function icon-x-block($size: 32, $color: #000000){
|
85
|
-
@return svg-encode('<svg width="#{$size}px" height="#{$size}px" fill="#{$color}" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10.5 10.5" style="enable-background:new 0 0 10.5 10.5;" xml:space="preserve"><path d="M8.1,1.3C8.4,1,8.9,1,9.2,1.3c0,0,0,0,0,0c0.3,0.3,0.3,0.8,0,1.1L2.4,9.3c-0.3,0.3-0.8,0.3-1.1,0S1,8.4,1.3,8.1L8.1,1.3z"/><path d="M9.2,8.1c0.3,0.3,0.4,0.8,0.1,1.1c0,0,0,0,0,0l0,0c-0.3,0.3-0.8,0.3-1.1,0L1.3,2.4C1,2.1,0.9,1.6,1.3,1.3c0,0,0,0,0,0l0,0 C1.6,1,2.1,1,2.4,1.3L9.2,8.1z"/></svg>');
|
10
|
+
@return get($uniform_configs, 'sizes', $key);
|
86
11
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
@import 'uniform/
|
1
|
+
@import 'uniform/config';
|
2
|
+
@import 'uniform/functions/map';
|
2
3
|
|
3
4
|
@mixin text-overflow($inherit:false){
|
4
5
|
@if $inherit {
|
@@ -36,7 +37,7 @@
|
|
36
37
|
}
|
37
38
|
|
38
39
|
@mixin breakpoint($breakpoint){
|
39
|
-
@media only screen and (
|
40
|
+
@media only screen and (get($uniform_configs, 'breakpoints', $breakpoint)){
|
40
41
|
@content;
|
41
42
|
}
|
42
43
|
}
|
@@ -49,19 +50,19 @@
|
|
49
50
|
.#{$selector}{
|
50
51
|
@content
|
51
52
|
}
|
52
|
-
@if $
|
53
|
+
@if get($uniform_configs, 'breakpoints', 'include_containers') {
|
53
54
|
@include child-rule($selector) {
|
54
55
|
@content
|
55
56
|
}
|
56
57
|
}
|
57
58
|
|
58
|
-
@each $breakpoint, $breakpoint_query in $breakpoints {
|
59
|
+
@each $breakpoint, $breakpoint_query in map-get($uniform_configs, 'breakpoints') {
|
59
60
|
@include media($breakpoint_query){
|
60
61
|
.#{$breakpoint}\:#{$selector}{
|
61
62
|
@content
|
62
63
|
}
|
63
64
|
}
|
64
|
-
@if $
|
65
|
+
@if get($uniform_configs, 'breakpoints', 'include_containers') {
|
65
66
|
.#{$breakpoint}-container{
|
66
67
|
.#{$breakpoint}\:#{$selector}{
|
67
68
|
@content
|
@@ -87,7 +88,7 @@
|
|
87
88
|
$selector: str-slice($selector, 2, -1);
|
88
89
|
}
|
89
90
|
|
90
|
-
@each $name, $value in $
|
91
|
+
@each $name, $value in map-get($uniform_configs, 'colors') {
|
91
92
|
.#{$selector}-#{$name}{
|
92
93
|
@content($value)
|
93
94
|
}
|
@@ -96,10 +97,8 @@
|
|
96
97
|
@content($value)
|
97
98
|
}
|
98
99
|
|
99
|
-
@
|
100
|
-
@
|
101
|
-
@content($value)
|
102
|
-
}
|
100
|
+
@include combinator-rule("#{$selector}-#{$name}", false){
|
101
|
+
@content($value)
|
103
102
|
}
|
104
103
|
}
|
105
104
|
}
|
@@ -119,7 +118,7 @@
|
|
119
118
|
$key: str-slice($key, 1, str-index($key, '-') - 1);
|
120
119
|
}
|
121
120
|
|
122
|
-
@each $size, $value in
|
121
|
+
@each $size, $value in get($uniform_configs, 'sizes', $key) {
|
123
122
|
$class: "#{$selector}-#{$size}";
|
124
123
|
@if $size == '' {
|
125
124
|
$class: $selector;
|
@@ -144,26 +143,35 @@
|
|
144
143
|
}
|
145
144
|
}
|
146
145
|
|
147
|
-
@each $pseudo-selector, $pseudo-class in (
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
) {
|
156
|
-
@if index($include_pseudo_utilities, $pseudo-class) {
|
146
|
+
@each $pseudo-selector, $pseudo-class in map-get($uniform_configs, 'pseudo_classes') {
|
147
|
+
@if $pseudo-selector == "group-hover" {
|
148
|
+
.group:hover{
|
149
|
+
.group-hover\:#{$selector} {
|
150
|
+
@content
|
151
|
+
}
|
152
|
+
}
|
153
|
+
} @else {
|
157
154
|
.#{$pseudo-selector}\:#{$selector}:#{$pseudo-class} {
|
158
155
|
@content
|
159
156
|
}
|
160
157
|
}
|
158
|
+
|
161
159
|
}
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
160
|
+
}
|
161
|
+
|
162
|
+
@mixin combinator-rule($selector, $declare_self: true){
|
163
|
+
@if str-index($selector, '.') == 1 {
|
164
|
+
$selector: str-slice($selector, 2, -1);
|
165
|
+
}
|
166
|
+
@if $declare_self {
|
167
|
+
.#{$selector} {
|
168
|
+
@content
|
169
|
+
}
|
170
|
+
}
|
171
|
+
|
172
|
+
@each $cominator_selector, $combinator in map-get($uniform_configs, 'combinators') {
|
173
|
+
.#{$selector}-#{$cominator_selector} #{$combinator} * {
|
174
|
+
@content
|
167
175
|
}
|
168
176
|
}
|
169
177
|
}
|