@microsoft/atlas-css 3.33.0 → 3.34.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/atlas-css",
3
- "version": "3.33.0",
3
+ "version": "3.34.0",
4
4
  "description": "Styles backing the Atlas Design System used by Microsoft's Developer Relations.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -7,20 +7,24 @@ $banner-color: $info-dark !default;
7
7
  $banner-border-color: $border-white-high-contrast !default;
8
8
  $banner-border-width: $border-width !default;
9
9
 
10
+ $banner-dismiss-margin: $spacer-2 !default;
11
+
10
12
  .banner {
11
13
  @extend %layout-gap;
12
14
 
13
- display: block;
15
+ display: grid;
14
16
  position: relative;
17
+ grid-template: auto / 1fr auto;
18
+ grid-template-areas: 'banner-content dismiss';
15
19
  outline-color: $text;
16
20
  background-color: $banner-background;
17
21
  color: $banner-color;
18
22
  font-size: $banner-font-size;
23
+ line-height: $line-height-normal;
19
24
  padding-block: $banner-padding;
20
25
  word-wrap: break-word;
21
26
  word-break: break-word;
22
27
  border-block: $banner-border-width solid $banner-border-color;
23
- line-height: $line-height-normal;
24
28
 
25
29
  &.is-loading {
26
30
  color: transparent;
@@ -33,16 +37,33 @@ $banner-border-width: $border-width !default;
33
37
  @include loader;
34
38
 
35
39
  position: absolute;
40
+ inset-block-start: $banner-padding;
41
+ inset-inline-start: $layout-gap;
36
42
  border-color: transparent transparent $banner-color $banner-color;
43
+
44
+ @include widescreen {
45
+ inset-inline-start: $layout-widescreen-gap;
46
+ }
37
47
  }
38
48
  }
39
49
 
40
- a:not(.button) {
41
- color: currentColor;
42
- font-weight: $weight-semibold;
50
+ .banner-content {
51
+ grid-area: banner-content;
43
52
 
44
- .theme-high-contrast & {
45
- color: $hyperlink;
53
+ a:not(.button) {
54
+ color: currentColor;
55
+ font-weight: $weight-semibold;
56
+
57
+ .theme-high-contrast & {
58
+ color: $hyperlink;
59
+ }
46
60
  }
47
61
  }
62
+
63
+ .banner-dismiss {
64
+ @include dismiss-square;
65
+
66
+ grid-area: dismiss;
67
+ margin-inline-start: $banner-dismiss-margin;
68
+ }
48
69
  }
@@ -11,19 +11,23 @@ $notification-border-radius: $border-radius !default;
11
11
  $notification-icon-inline-spacing: 0.375em !default;
12
12
  $notification-icon-block-spacing: 0.2em !default;
13
13
 
14
+ $notification-dismiss-margin: $spacer-2 !default;
15
+
14
16
  .notification {
15
- display: block;
17
+ display: grid;
16
18
  position: relative;
17
19
  padding: $notification-padding;
20
+ grid-template: auto / 1fr auto;
21
+ grid-template-areas: 'notification-content dismiss';
18
22
  border: $notification-border-width solid $notification-border-color;
19
23
  border-radius: $notification-border-radius;
20
24
  outline-color: $text;
21
25
  background-color: $notification-background;
22
26
  color: $notification-color;
23
27
  font-size: $notification-font-size;
28
+ line-height: $line-height-normal;
24
29
  word-wrap: break-word;
25
30
  word-break: break-word;
26
- line-height: $line-height-normal;
27
31
 
28
32
  @each $name, $color-set in $colors {
29
33
  $base: nth($color-set, $color-index-base);
@@ -58,29 +62,40 @@ $notification-icon-block-spacing: 0.2em !default;
58
62
  }
59
63
  }
60
64
 
61
- .notification-title,
62
- a:not(.button) {
63
- color: currentColor;
64
- font-weight: $weight-semibold;
65
- }
65
+ .notification-content {
66
+ grid-area: notification-content;
66
67
 
67
- a:not(.button) {
68
- .theme-high-contrast & {
69
- color: $hyperlink;
68
+ .notification-title,
69
+ a:not(.button) {
70
+ color: currentColor;
71
+ font-weight: $weight-semibold;
70
72
  }
71
- }
72
73
 
73
- .notification-title {
74
- display: flex;
75
- align-items: center;
76
- justify-content: flex-start;
77
- margin-block-end: $layout-1;
78
-
79
- .icon {
80
- flex-shrink: 0;
81
- align-self: start;
82
- margin-inline-end: $notification-icon-inline-spacing;
83
- margin-block-start: $notification-icon-block-spacing;
74
+ a:not(.button) {
75
+ .theme-high-contrast & {
76
+ color: $hyperlink;
77
+ }
84
78
  }
79
+
80
+ .notification-title {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: flex-start;
84
+ margin-block-end: $layout-1;
85
+
86
+ .icon {
87
+ flex-shrink: 0;
88
+ align-self: start;
89
+ margin-inline-end: $notification-icon-inline-spacing;
90
+ margin-block-start: $notification-icon-block-spacing;
91
+ }
92
+ }
93
+ }
94
+
95
+ .notification-dismiss {
96
+ @include dismiss-square;
97
+
98
+ grid-area: dismiss;
99
+ margin-inline-start: $notification-dismiss-margin;
85
100
  }
86
101
  }
@@ -24,3 +24,32 @@
24
24
  transform: scale(1);
25
25
  }
26
26
  }
27
+
28
+ @keyframes slide-up-fade-out {
29
+ 100% {
30
+ transform: translateY(-100%);
31
+ opacity: 0;
32
+ }
33
+ }
34
+
35
+ @keyframes fade-out {
36
+ 100% {
37
+ opacity: 0;
38
+ }
39
+ }
40
+
41
+ .animation-fade {
42
+ animation: fade-out 0.4s ease-in forwards;
43
+
44
+ @include prefers-reduced-motion {
45
+ animation-duration: 0s;
46
+ }
47
+ }
48
+
49
+ .animation-slide-up {
50
+ animation: slide-up-fade-out 0.4s ease-in forwards;
51
+
52
+ @include prefers-reduced-motion {
53
+ animation-duration: 0s;
54
+ }
55
+ }
@@ -0,0 +1,22 @@
1
+ %dismiss {
2
+ @include transparent-effects;
3
+
4
+ display: inline-block;
5
+ color: currentColor;
6
+ font-size: 1rem;
7
+ cursor: pointer;
8
+ }
9
+
10
+ @mixin dismiss {
11
+ @extend %dismiss;
12
+ }
13
+
14
+ @mixin dismiss-square {
15
+ @extend %dismiss;
16
+
17
+ width: 1em;
18
+ height: 1em;
19
+ padding: 0;
20
+ border: 0;
21
+ border-radius: $border-radius-rounded;
22
+ }
@@ -12,5 +12,6 @@
12
12
  @import './force-colors.scss';
13
13
  @import './overlay.scss';
14
14
  @import './transparency.scss';
15
+ @import './dismiss.scss';
15
16
  @import './unselectable.scss';
16
17
  @import './visually-hidden.scss';
@@ -53,3 +53,9 @@
53
53
  @content;
54
54
  }
55
55
  }
56
+
57
+ @mixin prefers-reduced-motion {
58
+ @media (prefers-reduced-motion: reduce) {
59
+ @content;
60
+ }
61
+ }