@microsoft/atlas-css 1.2.0 → 1.3.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.
Files changed (63) hide show
  1. package/README.md +42 -42
  2. package/dist/index.css +1 -1
  3. package/dist/index.css.map +1 -1
  4. package/package.json +57 -57
  5. package/src/atomics/README.md +54 -54
  6. package/src/atomics/border.scss +56 -56
  7. package/src/atomics/colors.scss +166 -166
  8. package/src/atomics/display.scss +33 -33
  9. package/src/atomics/flex.scss +69 -69
  10. package/src/atomics/index.scss +8 -8
  11. package/src/atomics/position.scss +19 -19
  12. package/src/atomics/shadow.scss +19 -19
  13. package/src/atomics/spacing.scss +73 -73
  14. package/src/atomics/typography.scss +105 -105
  15. package/src/components/README.md +41 -41
  16. package/src/components/button-reset.scss +8 -8
  17. package/src/components/button.scss +245 -243
  18. package/src/components/buttons.scss +86 -87
  19. package/src/components/component.md +6 -6
  20. package/src/components/icon.scss +20 -20
  21. package/src/components/index.scss +7 -7
  22. package/src/components/link-button.scss +30 -30
  23. package/src/components/markdown.scss +156 -156
  24. package/src/components/table.scss +67 -67
  25. package/src/core/animations.scss +8 -8
  26. package/src/core/focus.scss +35 -35
  27. package/src/core/font-stack.scss +28 -28
  28. package/src/core/index.scss +6 -6
  29. package/src/core/themes.scss +86 -86
  30. package/src/index.scss +6 -6
  31. package/src/mixins/center.scss +11 -11
  32. package/src/mixins/code-block.scss +43 -43
  33. package/src/mixins/control.scss +44 -44
  34. package/src/mixins/focus.scss +10 -10
  35. package/src/mixins/font-size.scss +35 -35
  36. package/src/mixins/index.scss +9 -9
  37. package/src/mixins/loader.scss +16 -16
  38. package/src/mixins/media-queries.scss +49 -49
  39. package/src/mixins/transparency.scss +14 -14
  40. package/src/mixins/unselectable.scss +13 -13
  41. package/src/patterns/index.scss +1 -1
  42. package/src/tokens/animation.scss +8 -8
  43. package/src/tokens/border.scss +8 -8
  44. package/src/tokens/breakpoints.scss +11 -11
  45. package/src/tokens/colors.scss +215 -215
  46. package/src/tokens/direction.scss +18 -18
  47. package/src/tokens/display.scss +5 -5
  48. package/src/tokens/focus.scss +9 -9
  49. package/src/tokens/font-stack.scss +10 -10
  50. package/src/tokens/index.scss +18 -18
  51. package/src/tokens/layout.scss +8 -8
  52. package/src/tokens/palette.scss +188 -188
  53. package/src/tokens/position.scss +5 -5
  54. package/src/tokens/radius.scss +9 -9
  55. package/src/tokens/schemes.scss +14 -14
  56. package/src/tokens/shadow.scss +11 -11
  57. package/src/tokens/spacing.scss +25 -25
  58. package/src/tokens/themes.scss +291 -291
  59. package/src/tokens/typography.scss +29 -29
  60. package/src/tokens/z-index.scss +20 -20
  61. package/tokens/README.md +34 -34
  62. package/tokens/index.js +246 -246
  63. package/tokens/types.d.ts +35 -35
@@ -1,41 +1,41 @@
1
- # Atlas CSS Components
2
-
3
- Each of the files in this folder (or subfolders) contain one Atlas component.
4
-
5
- ## Guidance
6
-
7
- There are a few things to think about when adding a new component, though none of them are strict rules.
8
-
9
- - include only one top-level class per file.
10
- - subclasses (classes that to go inside the main class) are fine.
11
- - modifier classes on the main class are also fine.
12
- - seek to nest only two levels deep, three at most.
13
-
14
- ```scss
15
- // main class
16
- .component {
17
- [...]
18
-
19
- .is-large {
20
- [...]
21
- }
22
-
23
- .component-sub {
24
- [...]
25
- }
26
-
27
- .component-sub-component {
28
- [...]
29
- }
30
- }
31
- ```
32
-
33
- ## Direction
34
-
35
- When horizontal (inline) direction is important to a component, the user's direction should be interpolated into the appropriate place(s).
36
-
37
- ```scss
38
- .thing-with-side-border {
39
- border-#{$user-left}: 1px solid magenta;
40
- }
41
- ```
1
+ # Atlas CSS Components
2
+
3
+ Each of the files in this folder (or subfolders) contain one Atlas component.
4
+
5
+ ## Guidance
6
+
7
+ There are a few things to think about when adding a new component, though none of them are strict rules.
8
+
9
+ - include only one top-level class per file.
10
+ - subclasses (classes that to go inside the main class) are fine.
11
+ - modifier classes on the main class are also fine.
12
+ - seek to nest only two levels deep, three at most.
13
+
14
+ ```scss
15
+ // main class
16
+ .component {
17
+ [...]
18
+
19
+ .is-large {
20
+ [...]
21
+ }
22
+
23
+ .component-sub {
24
+ [...]
25
+ }
26
+
27
+ .component-sub-component {
28
+ [...]
29
+ }
30
+ }
31
+ ```
32
+
33
+ ## Direction
34
+
35
+ When horizontal (inline) direction is important to a component, the user's direction should be interpolated into the appropriate place(s).
36
+
37
+ ```scss
38
+ .thing-with-side-border {
39
+ border-#{$user-left}: 1px solid magenta;
40
+ }
41
+ ```
@@ -1,8 +1,8 @@
1
- .button-reset {
2
- @include transparent-effects;
3
-
4
- display: inline-block;
5
- padding: 0;
6
- border: 0;
7
- cursor: pointer;
8
- }
1
+ .button-reset {
2
+ @include transparent-effects;
3
+
4
+ display: inline-block;
5
+ padding: 0;
6
+ border: 0;
7
+ cursor: pointer;
8
+ }
@@ -1,243 +1,245 @@
1
- @use 'sass:map';
2
-
3
- $button-color: $text !default;
4
- $button-background-color: $body-background !default;
5
-
6
- $button-large-font-size: $font-size-6 !default;
7
- $button-small-font-size: $font-size-8 !default;
8
-
9
- $button-border-color: $text-subtle !default;
10
- $button-border-width: $control-border-width !default;
11
- $button-border-radius: $radius-small;
12
-
13
- $button-padding-vertical: calc(0.375em - #{$button-border-width}) !default;
14
- $button-padding-horizontal: 0.75em !default;
15
-
16
- $button-hover-color: $text !default;
17
- $button-hover-border-color: $default-hover !default;
18
- $button-hover-background-color: $default-hover-invert !default;
19
-
20
- $button-disabled-background-color: $body-background-medium !default;
21
- $button-disabled-shadow: none !default;
22
- $button-disabled-opacity: 0.5 !default;
23
-
24
- $button-icon-spacing: 0.375em !default;
25
- $button-font-weight: $weight-semibold !default;
26
-
27
- .button {
28
- @include control;
29
- @include unselectable;
30
-
31
- justify-content: center;
32
- padding-top: $button-padding-vertical;
33
- padding-#{$user-left}: $button-padding-horizontal;
34
- padding-#{$user-right}: $button-padding-horizontal;
35
- padding-bottom: $button-padding-vertical;
36
- border-width: $button-border-width;
37
- border-radius: $button-border-radius;
38
- border-color: $button-border-color;
39
- background-color: $button-background-color;
40
- color: $button-color;
41
- font-weight: $button-font-weight;
42
- text-align: center;
43
- white-space: nowrap;
44
- cursor: pointer;
45
-
46
- strong {
47
- color: inherit;
48
- }
49
-
50
- .icon {
51
- &:only-child {
52
- margin: 0;
53
- }
54
-
55
- &:first-child:not(:only-child) {
56
- margin-#{$user-right}: $button-icon-spacing;
57
- }
58
-
59
- &:last-child:not(:only-child) {
60
- margin-#{$user-left}: $button-icon-spacing;
61
- }
62
- }
63
-
64
- &:hover,
65
- &.is-hovered {
66
- border-color: $button-hover-border-color;
67
- background-color: $button-hover-background-color;
68
- color: $button-hover-color;
69
- }
70
-
71
- &:visited {
72
- color: $button-color;
73
- }
74
-
75
- // Sizes
76
-
77
- &.button-small {
78
- font-size: $button-small-font-size;
79
- }
80
-
81
- &.button-large {
82
- font-size: $button-large-font-size;
83
- }
84
-
85
- // Modifiers
86
-
87
- &.is-disabled,
88
- &[disabled] {
89
- border-color: currentColor;
90
- background-color: $button-disabled-background-color;
91
- opacity: $button-disabled-opacity;
92
- box-shadow: $button-disabled-shadow;
93
- }
94
-
95
- &.button-block {
96
- display: flex;
97
- width: 100%;
98
- }
99
-
100
- &.is-loading {
101
- color: transparent !important;
102
- pointer-events: none;
103
-
104
- &::after {
105
- @include loader;
106
- @include center(1em);
107
-
108
- position: absolute !important;
109
- border-bottom-color: $text;
110
- border-left-color: $text;
111
- }
112
- }
113
-
114
- @each $name, $color-set in $colors {
115
- $base: nth($color-set, $color-index-base);
116
- $dark: nth($color-set, $color-index-dark);
117
- $background: nth($color-set, $color-index-background);
118
-
119
- &.button-#{$name} {
120
- @if $name == 'warning' {
121
- border-color: $dark;
122
- color: $dark;
123
- } @else {
124
- border-color: $base;
125
- color: $base;
126
- }
127
-
128
- &:hover,
129
- &.is-hovered {
130
- background-color: $background;
131
- color: $dark;
132
- }
133
-
134
- &.is-loading::after {
135
- border-color: transparent transparent $base $base !important;
136
- }
137
- }
138
- }
139
- }
140
-
141
- $button-clear-hover-background-color: transparentize(#8e8e8e, 0.95) !default;
142
-
143
- .button.button-clear {
144
- border-color: transparent;
145
- background-color: transparent;
146
-
147
- &,
148
- &:visited {
149
- color: currentColor;
150
- }
151
-
152
- &.is-hovered,
153
- &:hover,
154
- &:active {
155
- background-color: $button-clear-hover-background-color;
156
- }
157
-
158
- @each $name, $color-set in $colors {
159
- $base: nth($color-set, $color-index-base);
160
- $dark: nth($color-set, $color-index-dark);
161
- $background: nth($color-set, $color-index-background);
162
-
163
- &.button-#{$name} {
164
- color: $base;
165
- @if $name == 'warning' {
166
- color: $dark;
167
- }
168
-
169
- &:hover,
170
- &.is-hovered {
171
- background-color: $background;
172
- color: $dark;
173
- }
174
-
175
- &.is-loading::after {
176
- border-color: transparent transparent $base $base !important;
177
- }
178
-
179
- &.button-disabled,
180
- &[disabled] {
181
- background-color: transparent;
182
- color: $base;
183
- box-shadow: none;
184
- }
185
- }
186
- }
187
- }
188
-
189
- $button-filled-background-color: $alternate-background-medium !default;
190
- $button-filled-background-color-hover: $alternate-background !default;
191
- $button-filled-text-color: $text-invert !default;
192
-
193
- .button.button-filled {
194
- border-color: $button-filled-background-color;
195
- background-color: $button-filled-background-color;
196
- color: $button-filled-text-color;
197
-
198
- &:hover,
199
- &.is-hovered {
200
- background-color: $button-filled-background-color-hover;
201
- }
202
-
203
- &.is-loading::after {
204
- @include loader;
205
-
206
- border-color: transparent transparent $button-filled-text-color $button-filled-text-color !important;
207
- }
208
-
209
- @each $name, $color-set in $colors {
210
- $base: nth($color-set, $color-index-base);
211
- $hover: nth($color-set, $color-index-hover);
212
- $active: nth($color-set, $color-index-active);
213
- $invert: nth($color-set, $color-index-invert);
214
- $background: nth($color-set, $color-index-background);
215
-
216
- &.button-#{$name} {
217
- border-color: $base;
218
- background-color: $base;
219
- color: $invert;
220
-
221
- &:hover,
222
- &.is-hovered {
223
- border-color: $hover;
224
- background-color: $hover;
225
- color: $invert;
226
- }
227
-
228
- &.is-loading::after {
229
- @include loader;
230
-
231
- border-color: transparent transparent $invert $invert !important;
232
- }
233
-
234
- &.button-disabled,
235
- &[disabled] {
236
- border-color: $base;
237
- background-color: transparent;
238
- color: $base;
239
- box-shadow: none;
240
- }
241
- }
242
- }
243
- }
1
+ @use 'sass:map';
2
+
3
+ $button-color: $text !default;
4
+ $button-background-color: $body-background !default;
5
+
6
+ $button-large-font-size: $font-size-6 !default;
7
+ $button-small-font-size: $font-size-8 !default;
8
+
9
+ $button-border-color: $text-subtle !default;
10
+ $button-border-width: $control-border-width !default;
11
+ $button-border-radius: $radius-small;
12
+
13
+ $button-padding-vertical: calc(0.375em - #{$button-border-width}) !default;
14
+ $button-padding-horizontal: 0.75em !default;
15
+
16
+ $button-hover-color: $text !default;
17
+ $button-hover-border-color: $default-hover !default;
18
+ $button-hover-background-color: $default-hover-invert !default;
19
+
20
+ $button-disabled-background-color: $body-background-medium !default;
21
+ $button-disabled-shadow: none !default;
22
+ $button-disabled-opacity: 0.5 !default;
23
+
24
+ $button-icon-spacing: 0.375em !default;
25
+ $button-font-weight: $weight-semibold !default;
26
+
27
+ .button {
28
+ @include control;
29
+ @include unselectable;
30
+
31
+ justify-content: center;
32
+ padding-top: $button-padding-vertical;
33
+ padding-#{$user-left}: $button-padding-horizontal;
34
+ padding-#{$user-right}: $button-padding-horizontal;
35
+ padding-bottom: $button-padding-vertical;
36
+ border-width: $button-border-width;
37
+ border-radius: $button-border-radius;
38
+ border-color: $button-border-color;
39
+ background-color: $button-background-color;
40
+ color: $button-color;
41
+ font-weight: $button-font-weight;
42
+ text-align: center;
43
+ white-space: nowrap;
44
+ cursor: pointer;
45
+
46
+ strong {
47
+ color: inherit;
48
+ }
49
+
50
+ .icon {
51
+ &:only-child {
52
+ margin: 0;
53
+ }
54
+
55
+ &:first-child:not(:only-child) {
56
+ margin-#{$user-right}: $button-icon-spacing;
57
+ }
58
+
59
+ &:last-child:not(:only-child) {
60
+ margin-#{$user-left}: $button-icon-spacing;
61
+ }
62
+ }
63
+
64
+ &:hover,
65
+ &.is-hovered {
66
+ border-color: $button-hover-border-color;
67
+ background-color: $button-hover-background-color;
68
+ color: $button-hover-color;
69
+ }
70
+
71
+ &:visited {
72
+ color: $button-color;
73
+ }
74
+
75
+ // Sizes
76
+
77
+ &.button-small {
78
+ font-size: $button-small-font-size;
79
+ }
80
+
81
+ &.button-large {
82
+ font-size: $button-large-font-size;
83
+ }
84
+
85
+ // Modifiers
86
+
87
+ &.is-disabled,
88
+ &[disabled] {
89
+ border-color: currentColor;
90
+ background-color: $button-disabled-background-color;
91
+ opacity: $button-disabled-opacity;
92
+ box-shadow: $button-disabled-shadow;
93
+ }
94
+
95
+ &.button-block {
96
+ display: flex;
97
+ width: 100%;
98
+ }
99
+
100
+ &.is-loading {
101
+ color: transparent !important;
102
+ pointer-events: none;
103
+
104
+ &::after {
105
+ @include loader;
106
+ @include center(1em);
107
+
108
+ position: absolute !important;
109
+ border-bottom-color: $text;
110
+ border-left-color: $text;
111
+ }
112
+ }
113
+
114
+ @each $name, $color-set in $colors {
115
+ $base: nth($color-set, $color-index-base);
116
+ $dark: nth($color-set, $color-index-dark);
117
+ $background: nth($color-set, $color-index-background);
118
+
119
+ &.button-#{$name} {
120
+ @if $name == 'warning' {
121
+ border-color: $dark;
122
+ color: $dark;
123
+ } @else {
124
+ border-color: $base;
125
+ color: $base;
126
+ }
127
+
128
+ &:hover,
129
+ &.is-hovered {
130
+ background-color: $background;
131
+ color: $dark;
132
+ }
133
+
134
+ &.is-loading::after {
135
+ border-color: transparent transparent $base $base !important;
136
+ }
137
+ }
138
+ }
139
+ }
140
+
141
+ $button-clear-hover-background-color: transparentize(#8e8e8e, 0.95) !default;
142
+
143
+ .button.button-clear {
144
+ border-color: transparent;
145
+ background-color: transparent;
146
+
147
+ &.border {
148
+ // an allowed hack to make for flexible outlined buttons
149
+ // does not support loading states
150
+ border-color: currentColor !important;
151
+ }
152
+
153
+ &,
154
+ &:visited {
155
+ color: currentColor;
156
+ }
157
+
158
+ &.is-hovered,
159
+ &:hover,
160
+ &:active {
161
+ background-color: $button-clear-hover-background-color;
162
+ }
163
+
164
+ @each $name, $color-set in $colors {
165
+ $base: nth($color-set, $color-index-base);
166
+ $dark: nth($color-set, $color-index-dark);
167
+ $background: nth($color-set, $color-index-background);
168
+
169
+ &.button-#{$name} {
170
+ color: $base;
171
+ @if $name == 'warning' {
172
+ color: $dark;
173
+ }
174
+
175
+ &:hover,
176
+ &.is-hovered {
177
+ background-color: $background;
178
+ color: $dark;
179
+ }
180
+
181
+ &.button-disabled,
182
+ &[disabled] {
183
+ background-color: transparent;
184
+ color: $base;
185
+ box-shadow: none;
186
+ }
187
+ }
188
+ }
189
+ }
190
+
191
+ $button-filled-background-color: $alternate-background-medium !default;
192
+ $button-filled-background-color-hover: $alternate-background !default;
193
+ $button-filled-text-color: $text-invert !default;
194
+
195
+ .button.button-filled {
196
+ border-color: $button-filled-background-color;
197
+ background-color: $button-filled-background-color;
198
+ color: $button-filled-text-color;
199
+
200
+ &:hover,
201
+ &.is-hovered {
202
+ background-color: $button-filled-background-color-hover;
203
+ }
204
+
205
+ &.is-loading::after {
206
+ @include loader;
207
+
208
+ border-color: transparent transparent $button-filled-text-color $button-filled-text-color !important;
209
+ }
210
+
211
+ @each $name, $color-set in $colors {
212
+ $base: nth($color-set, $color-index-base);
213
+ $hover: nth($color-set, $color-index-hover);
214
+ $active: nth($color-set, $color-index-active);
215
+ $invert: nth($color-set, $color-index-invert);
216
+ $background: nth($color-set, $color-index-background);
217
+
218
+ &.button-#{$name} {
219
+ border-color: $base;
220
+ background-color: $base;
221
+ color: $invert;
222
+
223
+ &:hover,
224
+ &.is-hovered {
225
+ border-color: $hover;
226
+ background-color: $hover;
227
+ color: $invert;
228
+ }
229
+
230
+ &.is-loading::after {
231
+ @include loader;
232
+
233
+ border-color: transparent transparent $invert $invert !important;
234
+ }
235
+
236
+ &.button-disabled,
237
+ &[disabled] {
238
+ border-color: $base;
239
+ background-color: transparent;
240
+ color: $base;
241
+ box-shadow: none;
242
+ }
243
+ }
244
+ }
245
+ }