sass-zero 0.0.44 → 0.0.48

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.
@@ -1,4 +1,5 @@
1
- @import "sass-zero/variables";
1
+ @import "sass-zero/variables/colors";
2
+ @import "sass-zero/variables/typography";
2
3
 
3
4
  /**
4
5
  * Manually forked from SUIT CSS Base: https://github.com/suitcss/base
@@ -31,16 +32,6 @@ button {
31
32
  background-image: none;
32
33
  }
33
34
 
34
- /**
35
- * Work around a Firefox/IE bug where the transparent `button` background
36
- * results in a loss of the default `button` focus styles.
37
- */
38
-
39
- button:focus {
40
- outline: 1px dotted;
41
- outline: 5px auto -webkit-focus-ring-color;
42
- }
43
-
44
35
  fieldset {
45
36
  margin: 0;
46
37
  padding: 0;
@@ -143,6 +134,7 @@ textarea {
143
134
 
144
135
  input::placeholder,
145
136
  textarea::placeholder {
137
+ opacity: 1;
146
138
  color: $gray-400;
147
139
  }
148
140
 
@@ -151,6 +143,18 @@ button,
151
143
  cursor: pointer;
152
144
  }
153
145
 
146
+ /**
147
+ * Override legacy focus reset from Normalize with modern Firefox focus styles.
148
+ *
149
+ * This is actually an improvement over the new defaults in Firefox in our testing,
150
+ * as it triggers the better focus styles even for links, which still use a dotted
151
+ * outline in Firefox by default.
152
+ */
153
+
154
+ :-moz-focusring {
155
+ outline: auto;
156
+ }
157
+
154
158
  table {
155
159
  border-collapse: collapse;
156
160
  }
@@ -208,11 +212,20 @@ samp {
208
212
  }
209
213
 
210
214
  /**
211
- * Make replaced elements `display: block` by default as that's
212
- * the behavior you want almost all of the time. Inspired by
213
- * CSS Remedy, with `svg` added as well.
215
+ * 1. Make replaced elements `display: block` by default as that's
216
+ * the behavior you want almost all of the time. Inspired by
217
+ * CSS Remedy, with `svg` added as well.
214
218
  *
215
- * https://github.com/mozdevs/cssremedy/issues/14
219
+ * https://github.com/mozdevs/cssremedy/issues/14
220
+ *
221
+ * 2. Add `vertical-align: middle` to align replaced elements more
222
+ * sensibly by default when overriding `display` by adding a
223
+ * utility like `inline`.
224
+ *
225
+ * This can trigger a poorly considered linting error in some
226
+ * tools but is included by design.
227
+ *
228
+ * https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210
216
229
  */
217
230
 
218
231
  img,
@@ -223,13 +236,13 @@ audio,
223
236
  iframe,
224
237
  embed,
225
238
  object {
226
- display: block;
227
- vertical-align: middle;
239
+ display: block; /* 1 */
240
+ vertical-align: middle; /* 2 */
228
241
  }
229
242
 
230
243
  /**
231
244
  * Constrain images and videos to the parent width and preserve
232
- * their instrinsic aspect ratio.
245
+ * their intrinsic aspect ratio.
233
246
  *
234
247
  * https://github.com/mozdevs/cssremedy/issues/14
235
248
  */
@@ -239,3 +252,11 @@ video {
239
252
  max-width: 100%;
240
253
  height: auto;
241
254
  }
255
+
256
+ /**
257
+ * Ensure the default browser behavior of the `hidden` attribute.
258
+ */
259
+
260
+ [hidden] {
261
+ display: none;
262
+ }
@@ -1,60 +1,53 @@
1
1
  @import "sass-zero/variables";
2
2
  @import "sass-zero/mixins";
3
3
 
4
- $color-bg--main: $white;
5
- $color-bg--surface: $gray-100;
6
- $color-primary: $gray-900;
7
- $color-txt: $gray-900;
8
- $color-focus-ring: rgba($gray-900, $opacity-50);
4
+ $font-family: $font-sans;
9
5
 
10
- $image-bg-select-black: url('data:image/svg+xml,<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 8l4 4 4-4"/></svg>');
11
- $image-checked-checkbox-white: url('data:image/svg+xml,<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>');
12
- $image-checked-radio-white: url('data:image/svg+xml,<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/></svg>');
6
+ $radius-input: $rounded;
7
+ $radius-button: $rounded;
13
8
 
14
- html {
15
- background: $color-bg--main;
16
- color: $color-txt;
17
- font-size: 14px;
18
- }
9
+ :root {
10
+ --color-bg--main: #{$white};
11
+ --color-bg--surface: #{$gray-100};
12
+ --color-primary: #{$gray-900};
13
+ --color-text: #{$gray-900};
14
+ --color-focus-ring: #{rgba($gray-900, $opacity-50)};
19
15
 
20
- main {
21
- padding-right: $size-2;
22
- padding-left: $size-2;
16
+ --image-bg-select: url('data:image/svg+xml,<svg viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path stroke="black" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 8l4 4 4-4"/></svg>');
17
+ --image-checked-checkbox: url('data:image/svg+xml,<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"/></svg>');
18
+ --image-checked-radio: url('data:image/svg+xml,<svg viewBox="0 0 16 16" fill="white" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/></svg>');
23
19
  }
24
20
 
25
- blockquote {
26
- border-color: $color-primary;
27
- border-left-width: $border-4;
28
- padding: $size-3 $size-4;
21
+ html {
22
+ background: var(--color-bg--main);
23
+ color: var(--color-text);
24
+ font-family: $font-family;
25
+ font-size: 16px;
29
26
  }
30
27
 
31
28
  .btn {
32
- border-radius: $rounded;
29
+ border-radius: $radius-button;
33
30
  border-width: $border;
34
31
  display: inline-block;
35
32
  font-weight: $font-bold;
36
33
  padding: $size-2 $size-4;
37
34
  cursor: pointer;
38
35
 
39
- &:focus {
40
- outline: 2px dotted $color-primary;
41
- outline-offset: 2px;
42
- }
43
-
44
36
  &:disabled {
45
37
  pointer-events: none;
46
38
  opacity: $opacity-50;
47
39
  }
48
40
 
49
41
  &--primary {
50
- background-color: $color-primary;
51
- border-color: $color-primary;
52
- color: $color-bg--main;
42
+ background-color: var(--color-primary);
43
+ border-color: var(--color-primary);
44
+ color: var(--color-bg--main);
53
45
  }
54
46
 
55
47
  &--secondary {
56
- background-color: $color-bg--main;
57
- border-color: $color-primary;
48
+ background-color: var(--color-bg--main);
49
+ border-color: var(--color-primary);
50
+ color: var(--color-primary);
58
51
  }
59
52
 
60
53
  &--tertiary {
@@ -63,43 +56,17 @@ blockquote {
63
56
  }
64
57
  }
65
58
 
66
- code {
67
- background-color: $color-bg--surface;
68
- border-radius: $rounded;
69
- font-size: $text-sm;
70
- margin: $size-0 $size-1;
71
- padding: $size-1 $size-2;
72
- white-space: nowrap;
73
- }
74
-
75
- pre {
76
- background-color: $color-bg--surface;
77
- border-color: $color-primary;
78
- border-left-width: $border-4;
79
- overflow-y: hidden;
80
-
81
- & > code {
82
- border-radius: $rounded-none;
83
- display: block;
84
- padding: $size-2 $size-3;
85
- white-space: pre;
86
- }
87
- }
88
-
89
- hr {
90
- margin: $size-6 $size-0;
91
- }
92
-
93
59
  .input {
60
+ resize: none;
94
61
  appearance: none;
95
62
  background-color: $transparent;
96
- border-radius: $rounded;
63
+ border-radius: $radius-input;
97
64
  border-width: $border;
98
65
  padding: $size-2 $size-3;
99
- width: $size-full;
66
+ width: $w-full;
100
67
 
101
68
  &--select {
102
- background-image: $image-bg-select-black;
69
+ background-image: var(--image-bg-select);
103
70
  background-position: right $size-2 center;
104
71
  background-repeat: no-repeat;
105
72
  background-size: auto $size-5;
@@ -107,56 +74,90 @@ hr {
107
74
  }
108
75
 
109
76
  &:focus {
110
- box-shadow: ring($color: $color-focus-ring);
77
+ box-shadow: ring($color: var(--color-focus-ring));
111
78
  @include outline-none;
112
79
  }
113
80
  }
114
81
 
115
82
  .checkbox {
116
83
  border-radius: $rounded;
117
- @include input-selection($color-primary);
84
+ @include input-selection(var(--color-primary));
118
85
 
119
86
  &:checked {
120
- background-image: $image-checked-checkbox-white;
87
+ background-image: var(--image-checked-checkbox);
121
88
  @include checked;
122
89
  }
123
90
 
124
91
  &:focus {
125
- box-shadow: ring($color: $color-focus-ring);
92
+ box-shadow: ring($color: var(--color-focus-ring));
126
93
  @include outline-none;
127
94
  }
128
95
  }
129
96
 
130
97
  .radio {
131
98
  border-radius: $rounded-full;
132
- @include input-selection($color-primary);
99
+ @include input-selection(var(--color-primary));
133
100
 
134
101
  &:checked {
135
- background-image: $image-checked-radio-white;
102
+ background-image: var(--image-checked-radio);
136
103
  @include checked;
137
104
  }
138
105
 
139
106
  &:focus {
140
- box-shadow: ring($color: $color-focus-ring);
107
+ box-shadow: ring($color: var(--color-focus-ring));
141
108
  @include outline-none;
142
109
  }
143
110
  }
144
111
 
145
- label, legend, dt {
146
- display: inline-block;
147
- margin-bottom: $size-1;
112
+ blockquote {
113
+ border-left-width: $border-4;
114
+ padding: $size-3 $size-4;
115
+ }
116
+
117
+ code {
118
+ background-color: var(--color-bg--surface);
119
+ border-radius: $rounded;
120
+ font-size: $text-sm;
121
+ margin: $size-0 $size-1;
122
+ padding: $size-1 $size-2;
123
+ white-space: nowrap;
124
+ }
125
+
126
+ pre {
127
+ background-color: var(--color-bg--surface);
128
+ border-left-width: $border-4;
129
+ overflow-y: hidden;
130
+
131
+ & > code {
132
+ border-radius: $rounded-none;
133
+ display: block;
134
+ padding: $size-2 $size-3;
135
+ white-space: pre;
136
+ }
137
+ }
138
+
139
+ hr {
140
+ margin: $size-6 $size-0;
148
141
  }
149
142
 
150
143
  a {
151
144
  font-weight: $font-bold;
152
145
  }
153
146
 
147
+ ul, ol {
148
+ padding-left: $size-10;
149
+ }
150
+
154
151
  ul {
155
- list-style: disc inside;
152
+ list-style: disc outside;
156
153
  }
157
154
 
158
155
  ol {
159
- list-style: decimal inside;
156
+ list-style: decimal outside;
157
+ }
158
+
159
+ label, legend, dt {
160
+ margin-bottom: $size-1;
160
161
  }
161
162
 
162
163
  h1, h2, h3, h4, h5, h6, .hdg {
@@ -172,13 +173,13 @@ blockquote, figure, p, pre, table, ul, ol, dl {
172
173
  }
173
174
 
174
175
  table {
175
- width: $size-full;
176
+ width: $w-full;
176
177
  }
177
178
 
178
179
  td, th {
179
180
  border-bottom-width: $border;
180
181
  padding: $size-3 $size-4;
181
- text-align: left;
182
+ text-align: inherit;
182
183
  }
183
184
 
184
185
  h1, h2, h3, h4, h5, h6, .hdg {
@@ -209,8 +210,3 @@ h5, .hdg--lg {
209
210
  h6, .hdg--base {
210
211
  font-size: $text-base;
211
212
  }
212
-
213
- @media (min-width: $breakpoint-md) {
214
- html { font-size: 16px; }
215
- main { @include make-container($size-10, $breakpoint-xl); }
216
- }
@@ -1,12 +1,7 @@
1
1
  @import "sass-zero/variables/border";
2
2
  @import "sass-zero/variables/effects";
3
3
  @import "sass-zero/variables/spacing";
4
-
5
- @mixin ellipsis {
6
- text-overflow: ellipsis;
7
- white-space: nowrap;
8
- overflow: hidden;
9
- }
4
+ @import "sass-zero/variables/zindex";
10
5
 
11
6
  @mixin antialiased {
12
7
  -webkit-font-smoothing: antialiased;
@@ -26,11 +21,10 @@
26
21
  }
27
22
  }
28
23
 
29
- @mixin checked {
30
- border-color: transparent;
31
- background-color: currentColor;
32
- background-position: center;
33
- background-repeat: no-repeat;
24
+ @mixin ellipsis {
25
+ text-overflow: ellipsis;
26
+ white-space: nowrap;
27
+ overflow: hidden;
34
28
  }
35
29
 
36
30
  @mixin input-selection($color) {
@@ -42,6 +36,13 @@
42
36
  width: $size-4;
43
37
  }
44
38
 
39
+ @mixin checked {
40
+ border-color: transparent;
41
+ background-color: currentColor;
42
+ background-position: center;
43
+ background-repeat: no-repeat;
44
+ }
45
+
45
46
  @mixin outline-none {
46
47
  outline: 2px solid transparent;
47
48
  outline-offset: 2px;
@@ -57,31 +58,10 @@
57
58
  outline-offset: 2px;
58
59
  }
59
60
 
60
- @mixin space-x($space, $reverse: false) {
61
- & > :not([hidden]) ~ :not([hidden]) {
62
- @if $reverse {
63
- margin-right: $space;
64
- } @else {
65
- margin-left: $space;
66
- }
67
- }
68
- }
69
-
70
- @mixin space-y($space, $reverse: false) {
71
- & > :not([hidden]) ~ :not([hidden]) {
72
- @if $reverse {
73
- margin-bottom: $space;
74
- } @else {
75
- margin-top: $space;
76
- }
77
- }
78
- }
79
-
80
- @mixin make-container($padding-x, $max-width) {
61
+ @mixin make-container($padding-x: $size-4) {
81
62
  width: 100%;
82
63
  padding-right: $padding-x;
83
64
  padding-left: $padding-x;
84
65
  margin-right: $size-auto;
85
66
  margin-left: $size-auto;
86
- max-width: $max-width;
87
67
  }
@@ -0,0 +1,28 @@
1
+ .align--top {
2
+ vertical-align: top;
3
+ }
4
+
5
+ .align--middle {
6
+ vertical-align: middle;
7
+ }
8
+
9
+ .align--bottom {
10
+ vertical-align: bottom;
11
+ }
12
+
13
+ .align--left {
14
+ text-align: left;
15
+ }
16
+
17
+ .align--center {
18
+ text-align: center;
19
+ }
20
+
21
+ .align--right {
22
+ text-align: right;
23
+ }
24
+
25
+ .centered {
26
+ margin-left: auto;
27
+ margin-right: auto
28
+ }
@@ -0,0 +1,36 @@
1
+ @import "sass-zero/variables/breakpoints";
2
+ @import "sass-zero/mixins";
3
+
4
+ .container {
5
+ @include make-container;
6
+ }
7
+
8
+ @media (min-width: $breakpoint-sm) {
9
+ .container {
10
+ max-width: $breakpoint-sm;
11
+ }
12
+ }
13
+
14
+ @media (min-width: $breakpoint-md) {
15
+ .container {
16
+ max-width: $breakpoint-md;
17
+ }
18
+ }
19
+
20
+ @media (min-width: $breakpoint-lg) {
21
+ .container {
22
+ max-width: $breakpoint-lg;
23
+ }
24
+ }
25
+
26
+ @media (min-width: $breakpoint-xl) {
27
+ .container {
28
+ max-width: $breakpoint-xl;
29
+ }
30
+ }
31
+
32
+ @media (min-width: $breakpoint-2xl) {
33
+ .container {
34
+ max-width: $breakpoint-2xl;
35
+ }
36
+ }
@@ -10,15 +10,15 @@
10
10
  flex-direction: column;
11
11
  }
12
12
 
13
- .flex--justify-center {
13
+ .flex--centered {
14
14
  justify-content: center;
15
15
  }
16
16
 
17
- .flex--justify-between {
17
+ .flex--space-items {
18
18
  justify-content: space-between;
19
19
  }
20
20
 
21
- .flex--items-center {
21
+ .flex--align-center {
22
22
  align-items: center;
23
23
  }
24
24
 
@@ -6,13 +6,26 @@
6
6
  width: 100%;
7
7
  }
8
8
 
9
+ .u-full-height {
10
+ height:100%
11
+ }
12
+
9
13
  .u-min-width {
10
14
  min-width: 0;
11
15
  }
12
16
 
13
17
  .u-disabled {
14
18
  pointer-events: none;
15
- opacity: $opacity-50;
19
+ opacity: $opacity-30;
20
+ }
21
+
22
+ .u-off-screen {
23
+ position: absolute;
24
+ left: -9999em;
25
+ }
26
+
27
+ .u-overflow-auto {
28
+ overflow: auto;
16
29
  }
17
30
 
18
31
  .u-unscrollable {
@@ -35,9 +48,25 @@
35
48
  display: none !important;
36
49
  }
37
50
 
38
- .u-centered {
39
- margin-right: auto;
51
+ .u-visibility-hidden {
52
+ visibility: hidden;
53
+ }
54
+
55
+ .u-pointer-events-n {
56
+ pointer-events: none;
57
+ }
58
+
59
+ .u-margin-centered {
40
60
  margin-left: auto;
61
+ margin-right: auto;
62
+ }
63
+
64
+ .u-wrap {
65
+ display: block;
66
+ }
67
+
68
+ .u-nowrap {
69
+ white-space: nowrap;
41
70
  }
42
71
 
43
72
  .u-clearfix {
@@ -68,6 +97,14 @@
68
97
  clear: right;
69
98
  }
70
99
 
100
+ .u-hide {
101
+ display: none;
102
+ }
103
+
104
+ .u-hide-focus {
105
+ outline: none !important;
106
+ }
107
+
71
108
  @media (max-width: $breakpoint-md - 1) {
72
109
  .u-hide\@small {
73
110
  display: none;
@@ -1,31 +1,41 @@
1
1
  @import "sass-zero/variables/spacing";
2
- @import "sass-zero/variables/colors";
3
2
  @import "sass-zero/mixins";
4
3
 
5
4
  .list--unindented {
6
- padding-left: $size-8;
5
+ padding-left: $size-4;
6
+ }
7
+
8
+ .list--flush {
9
+ padding-left: $size-0;
7
10
  }
8
11
 
9
12
  .list--unbulleted {
13
+ padding-left: $size-0;
10
14
  list-style: none;
11
15
  }
12
16
 
13
- .list--spaced {
14
- @include space-y($size-2);
17
+ .list--spaced > li + li {
18
+ margin-top: $size-2;
15
19
  }
16
20
 
17
- .list--boxed {
18
- background-color: $gray-200;
19
- padding: $size-4;
20
- border-radius: $rounded;
21
+ .list--inside-bulleted {
22
+ padding-left: $size-0;
23
+ list-style-position: inside;
21
24
  }
22
25
 
23
- .list--ruled > li {
24
- padding: $size-3 $size-4;
26
+ .list--ruled-top {
25
27
  border-top-width: $border;
26
28
  }
27
29
 
28
30
  .list--inline > li {
29
- margin-right: $size-2;
30
31
  display: inline-block;
31
32
  }
33
+
34
+ .list--inline > li + li {
35
+ margin-left: $size-2;
36
+ }
37
+
38
+ .list--ruled > li {
39
+ padding: $size-4 $size-2;
40
+ border-top-width: $border;
41
+ }
@@ -1,15 +1,23 @@
1
- .position-context {
1
+ .u-position-context {
2
2
  position: relative;
3
3
  }
4
4
 
5
- .position {
5
+ .u-position {
6
6
  position: absolute;
7
+ }
7
8
 
8
- &--right { right: 0; }
9
+ .u-position--right {
10
+ right: 0;
11
+ }
9
12
 
10
- &--left { left: 0; }
13
+ .u-position--left {
14
+ left: 0;
15
+ }
11
16
 
12
- &--top { top: 0; }
17
+ .u-position--top {
18
+ top: 0;
19
+ }
13
20
 
14
- &--bottom { bottom: 0; }
21
+ .u-position--bottom {
22
+ bottom: 0;
15
23
  }