@andreyshpigunov/x 0.5.5 → 0.5.8

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.
@@ -7,136 +7,103 @@ All right reserved.
7
7
  ----------------------------------------*/
8
8
 
9
9
 
10
- :root {
11
- --form-width: 40rem;
12
- --form-height-coeff: 2.6;
13
- --form-side-padding: 1rem;
10
+ input[type="color"],
11
+ input[type="date"],
12
+ input[type="datetime"],
13
+ input[type="tel"],
14
+ input[type="email"],
15
+ input[type="month"],
16
+ input[type="number"],
17
+ input[type="password"],
18
+ input[type="search"],
19
+ input[type="text"],
20
+ input[type="time"],
21
+ input[type="url"],
22
+ input[type="week"],
23
+ input:not([type]),
24
+ textarea,
25
+ select {
26
+ position: relative;
27
+ width: 100%;
28
+ height: var(--form-height);
29
+ height: var(--form-height, calc(var(--form-font-size) * var(--form-height-coeff)));
30
+ margin: 0;
31
+ padding: 0 var(--form-side-padding);
32
+ font-size: var(--form-font-size);
33
+ color: var(--form-font-color);
34
+ outline: none;
35
+ border-width: var(--form-border-width);
36
+ border-style: solid;
37
+ border-color: var(--form-border-color);
38
+ border-radius: var(--form-border-radius);
39
+ background-color: var(--form-background-color);
40
+ appearance: none;
14
41
 
15
- --form-font-size: var(--font-size);
16
- --form-font-color: #000;
17
- --form-font-color-readonly: #000;
18
- --form-font-color-disabled: #666;
19
- --form-font-color-placeholder: #ccc;
20
-
21
- --form-border-width: .1rem;
22
- --form-border-radius: .8rem;
23
- --form-border-color: #d4d4d4;
24
- --form-border-color-focused: #8cf;
25
- --form-border-color-error: #f00;
26
- --form-border-color-readonly: #ddd;
27
- --form-border-color-disabled: #ddd;
28
-
29
- --form-background-color: #fff;
30
- --form-background-color-readonly: #fafafa;
31
- --form-background-color-disabled: #f6f6f6;
32
-
33
- /*
34
- Additional variables and their default values:
35
- --form-height: 4rem;
36
- */
37
- }
38
-
39
- @layer form {
40
-
41
- input[type="color"],
42
- input[type="date"],
43
- input[type="datetime"],
44
- input[type="tel"],
45
- input[type="email"],
46
- input[type="month"],
47
- input[type="number"],
48
- input[type="password"],
49
- input[type="search"],
50
- input[type="text"],
51
- input[type="time"],
52
- input[type="url"],
53
- input[type="week"],
54
- input:not([type]),
55
- textarea,
56
- select {
57
- position: relative;
58
- width: 100%;
59
- height: var(--form-height);
60
- height: var(--form-height, calc(var(--form-font-size) * var(--form-height-coeff)));
61
- margin: 0;
62
- padding: 0 var(--form-side-padding);
63
- font-size: var(--form-font-size);
64
- color: var(--form-font-color);
65
- outline: none;
66
- border-width: var(--form-border-width);
67
- border-style: solid;
68
- border-color: var(--form-border-color);
69
- border-radius: var(--form-border-radius);
70
- background-color: var(--form-background-color);
71
- appearance: none;
72
-
73
- &[readonly],
74
- &[readonly]:focus {
75
- color: var(--form-font-color-readonly);
76
- border-color: var(--form-border-color-readonly);
77
- background-color: var(--form-background-color-readonly);
78
- box-shadow: none;
79
- }
80
- &[disabled],
81
- &[disabled]:focus {
82
- color: var(--form-font-color-disabled);
83
- border-color: var(--form-border-color-disabled);
84
- background-color: var(--form-background-color-disabled);
85
- cursor: not-allowed;
86
- box-shadow: none;
87
- }
88
-
89
- &:focus {
90
- border-color: var(--form-border-color-focused);
91
- box-shadow: 0 0 0 1px var(--form-border-color-focused);
92
- }
93
- &.error,
94
- &.error:focus,
95
- &[pattern]:invalid,
96
- &[pattern]:invalid:focus {
97
- border-color: var(--form-border-color-error);
98
- box-shadow: 0 0 0 1px var(--form-border-color-error);
99
- }
100
- }
101
-
102
- select {
103
- padding-right: calc(var(--form-side-padding) * 2.6);
104
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' class='lucide lucide-chevrons-up-down-icon lucide-chevrons-up-down'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E");
105
- background-position: right calc(var(--form-side-padding) - 4px) top 52%, 0 0;
106
- background-repeat: no-repeat;
107
- background-size: 1.6rem;
108
- }
109
-
110
- ::placeholder {
111
- color: var(--form-font-color-placeholder);
112
- }
113
-
114
- input[placeholder],
115
- input::-moz-placeholder,
116
- input:-moz-placeholder,
117
- input:-ms-input-placeholder {
118
- text-overflow: ellipsis;
42
+ &[readonly],
43
+ &[readonly]:focus {
44
+ color: var(--form-font-color-readonly);
45
+ border-color: var(--form-border-color-readonly);
46
+ background-color: var(--form-background-color-readonly);
47
+ box-shadow: none;
119
48
  }
120
-
121
- input,
122
- textarea,
123
- select,
124
- button {
125
- max-width: var(--form-width);
126
- font-family: inherit;
127
- font-size: var(--font-size);
128
- box-sizing: border-box;
49
+ &[disabled],
50
+ &[disabled]:focus {
51
+ color: var(--form-font-color-disabled);
52
+ border-color: var(--form-border-color-disabled);
53
+ background-color: var(--form-background-color-disabled);
54
+ cursor: not-allowed;
129
55
  box-shadow: none;
130
56
  }
131
-
132
- textarea {
133
- height: auto;
134
- padding-top: calc(var(--form-side-padding) / 2);
135
- padding-bottom: calc(var(--form-side-padding) / 2);
57
+
58
+ &:focus {
59
+ border-color: var(--form-border-color-focused);
60
+ box-shadow: 0 0 0 1px var(--form-border-color-focused);
136
61
  }
137
-
138
- ::-webkit-file-upload-button {
139
- cursor:pointer;
62
+ &.error,
63
+ &.error:focus,
64
+ &[pattern]:invalid,
65
+ &[pattern]:invalid:focus {
66
+ border-color: var(--form-border-color-error);
67
+ box-shadow: 0 0 0 1px var(--form-border-color-error);
140
68
  }
69
+ }
70
+
71
+ select {
72
+ padding-right: calc(var(--form-side-padding) * 2.6);
73
+ background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23888' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' class='lucide lucide-chevrons-up-down-icon lucide-chevrons-up-down'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E");
74
+ background-position: right calc(var(--form-side-padding) - 4px) top 52%, 0 0;
75
+ background-repeat: no-repeat;
76
+ background-size: 1.6rem;
77
+ }
78
+
79
+ ::placeholder {
80
+ color: var(--form-font-color-placeholder);
81
+ }
82
+
83
+ input[placeholder],
84
+ input::-moz-placeholder,
85
+ input:-moz-placeholder,
86
+ input:-ms-input-placeholder {
87
+ text-overflow: ellipsis;
88
+ }
89
+
90
+ input,
91
+ textarea,
92
+ select,
93
+ button {
94
+ max-width: var(--form-width);
95
+ font-family: inherit;
96
+ font-size: var(--font-size);
97
+ box-sizing: border-box;
98
+ box-shadow: none;
99
+ }
100
+
101
+ textarea {
102
+ height: auto;
103
+ padding-top: calc(var(--form-side-padding) / 2);
104
+ padding-bottom: calc(var(--form-side-padding) / 2);
105
+ }
141
106
 
107
+ ::-webkit-file-upload-button {
108
+ cursor:pointer;
142
109
  }
@@ -14,116 +14,112 @@ All right reserved.
14
14
  .grid > .c[1-12]/[1-12] (s,m,l,xl) - columns range for content
15
15
  */
16
16
 
17
- @layer grid {
18
-
19
- .grid { display: grid }
20
-
21
- [class*=grid] {
22
- width: 100%;
23
- grid-template-columns: repeat(12, 1fr);
24
- grid-auto-flow: dense;
17
+ .grid { display: grid }
18
+
19
+ [class*=grid] {
20
+ width: 100%;
21
+ grid-template-columns: repeat(12, 1fr);
22
+ grid-auto-flow: dense;
23
+
24
+ @for $i from 1 to 12 {
25
+ &.g$(i) { grid-template-columns: repeat($(i), 1fr) }
26
+ & > .c$(i) { grid-column: span $(i) }
27
+ @for $m from 12 to $i {
28
+ & > .c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
29
+ }
30
+ }
25
31
 
32
+ @media (min-width: 640px) {
26
33
  @for $i from 1 to 12 {
27
- &.g$(i) { grid-template-columns: repeat($(i), 1fr) }
28
- & > .c$(i) { grid-column: span $(i) }
34
+ &.s\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
35
+ & > .s\:c$(i) { grid-column: span $(i) }
29
36
  @for $m from 12 to $i {
30
- & > .c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
37
+ & > .s\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
31
38
  }
32
39
  }
33
-
34
- @media (min-width: 640px) {
35
- @for $i from 1 to 12 {
36
- &.s\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
37
- & > .s\:c$(i) { grid-column: span $(i) }
38
- @for $m from 12 to $i {
39
- & > .s\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
40
- }
41
- }
42
- }
43
-
44
- @media (min-width: 768px) {
45
- @for $i from 1 to 12 {
46
- &.m\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
47
- & > .m\:c$(i) { grid-column: span $(i) }
48
- @for $m from 12 to $i {
49
- & > .m\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
50
- }
51
- }
52
- }
53
-
54
- @media (min-width: 1024px) {
55
- @for $i from 1 to 12 {
56
- &.l\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
57
- & > .l\:c$(i) { grid-column: span $(i) }
58
- @for $m from 12 to $i {
59
- & > .l\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
60
- }
61
- }
62
- }
63
-
64
- @media (min-width: 1280px) {
65
- @for $i from 1 to 12 {
66
- &.xl\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
67
- & > .xl\:c$(i) { grid-column: span $(i) }
68
- @for $m from 12 to $i {
69
- & > .xl\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
70
- }
71
- }
72
- }
73
- }
74
-
75
- .jss { justify-self: start }
76
- .jse { justify-self: end }
77
- .jsc { justify-self: center }
78
- .jsstr { justify-self: stretch }
79
- .ass { align-self: start }
80
- .ase { align-self: end }
81
- .asc { align-self: center }
82
- .asstr { align-self: stretch }
83
-
84
- @media (min-width: 640px) {
85
- .s\:jss { justify-self: start }
86
- .s\:jse { justify-self: end }
87
- .s\:jsc { justify-self: center }
88
- .s\:jsstr { justify-self: stretch }
89
- .s\:ass { align-self: start }
90
- .s\:ase { align-self: end }
91
- .s\:asc { align-self: center }
92
- .s\:asstr { align-self: stretch }
93
40
  }
94
-
41
+
95
42
  @media (min-width: 768px) {
96
- .m\:jss { justify-self: start }
97
- .m\:jse { justify-self: end }
98
- .m\:jsc { justify-self: center }
99
- .m\:jsstr { justify-self: stretch }
100
- .m\:ass { align-self: start }
101
- .m\:ase { align-self: end }
102
- .m\:asc { align-self: center }
103
- .m\:asstr { align-self: stretch }
43
+ @for $i from 1 to 12 {
44
+ &.m\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
45
+ & > .m\:c$(i) { grid-column: span $(i) }
46
+ @for $m from 12 to $i {
47
+ & > .m\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
48
+ }
49
+ }
104
50
  }
105
-
51
+
106
52
  @media (min-width: 1024px) {
107
- .l\:jss { justify-self: start }
108
- .l\:jse { justify-self: end }
109
- .l\:jsc { justify-self: center }
110
- .l\:jsstr { justify-self: stretch }
111
- .l\:ass { align-self: start }
112
- .l\:ase { align-self: end }
113
- .l\:asc { align-self: center }
114
- .l\:asstr { align-self: stretch }
53
+ @for $i from 1 to 12 {
54
+ &.l\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
55
+ & > .l\:c$(i) { grid-column: span $(i) }
56
+ @for $m from 12 to $i {
57
+ & > .l\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
58
+ }
59
+ }
115
60
  }
116
-
117
-
61
+
118
62
  @media (min-width: 1280px) {
119
- .xl\:jss { justify-self: start }
120
- .xl\:jse { justify-self: end }
121
- .xl\:jsc { justify-self: center }
122
- .xl\:jsstr { justify-self: stretch }
123
- .xl\:ass { align-self: start }
124
- .xl\:ase { align-self: end }
125
- .xl\:asc { align-self: center }
126
- .xl\:asstr { align-self: stretch }
63
+ @for $i from 1 to 12 {
64
+ &.xl\:g$(i) { grid-template-columns: repeat($(i), 1fr) }
65
+ & > .xl\:c$(i) { grid-column: span $(i) }
66
+ @for $m from 12 to $i {
67
+ & > .xl\:c$(i)\/$(m) { grid-column: $(i) / calc($(m) + 1) }
68
+ }
69
+ }
127
70
  }
71
+ }
72
+
73
+ .jss { justify-self: start }
74
+ .jse { justify-self: end }
75
+ .jsc { justify-self: center }
76
+ .jsstr { justify-self: stretch }
77
+ .ass { align-self: start }
78
+ .ase { align-self: end }
79
+ .asc { align-self: center }
80
+ .asstr { align-self: stretch }
81
+
82
+ @media (min-width: 640px) {
83
+ .s\:jss { justify-self: start }
84
+ .s\:jse { justify-self: end }
85
+ .s\:jsc { justify-self: center }
86
+ .s\:jsstr { justify-self: stretch }
87
+ .s\:ass { align-self: start }
88
+ .s\:ase { align-self: end }
89
+ .s\:asc { align-self: center }
90
+ .s\:asstr { align-self: stretch }
91
+ }
92
+
93
+ @media (min-width: 768px) {
94
+ .m\:jss { justify-self: start }
95
+ .m\:jse { justify-self: end }
96
+ .m\:jsc { justify-self: center }
97
+ .m\:jsstr { justify-self: stretch }
98
+ .m\:ass { align-self: start }
99
+ .m\:ase { align-self: end }
100
+ .m\:asc { align-self: center }
101
+ .m\:asstr { align-self: stretch }
102
+ }
103
+
104
+ @media (min-width: 1024px) {
105
+ .l\:jss { justify-self: start }
106
+ .l\:jse { justify-self: end }
107
+ .l\:jsc { justify-self: center }
108
+ .l\:jsstr { justify-self: stretch }
109
+ .l\:ass { align-self: start }
110
+ .l\:ase { align-self: end }
111
+ .l\:asc { align-self: center }
112
+ .l\:asstr { align-self: stretch }
113
+ }
114
+
128
115
 
116
+ @media (min-width: 1280px) {
117
+ .xl\:jss { justify-self: start }
118
+ .xl\:jse { justify-self: end }
119
+ .xl\:jsc { justify-self: center }
120
+ .xl\:jsstr { justify-self: stretch }
121
+ .xl\:ass { align-self: start }
122
+ .xl\:ase { align-self: end }
123
+ .xl\:asc { align-self: center }
124
+ .xl\:asstr { align-self: stretch }
129
125
  }