Skip to content

Commit 6795d2a

Browse files
author
Michael Jordan
authored
fix(#4049): Express theme should render a border on Popovers and Dialogs with forced-colors: active (#4050)
1 parent 2487c50 commit 6795d2a

File tree

9 files changed

+57
-7
lines changed

9 files changed

+57
-7
lines changed

packages/@adobe/spectrum-css-temp/components/dialog/index.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,14 @@ governing permissions and limitations under the License.
5959
max-width: 100%;
6060

6161
max-height: inherit;
62-
62+
overflow: hidden;
6363
outline: none;
6464

6565
--spectrum-dialog-padding-x: var(--spectrum-dialog-padding);
6666
--spectrum-dialog-padding-y: var(--spectrum-dialog-padding);
6767
--spectrum-dialog-border-radius: var(--spectrum-border-radius);
68+
69+
border-radius: var(--spectrum-dialog-border-radius);
6870
}
6971

7072
.spectrum-Dialog--small {
@@ -271,6 +273,7 @@ governing permissions and limitations under the License.
271273
width: 100%;
272274
height: 100%;
273275

276+
border-style: none;
274277
border-radius: 0;
275278
}
276279
/** @unofficial */

packages/@adobe/spectrum-css-temp/components/dialog/skin.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,3 @@ governing permissions and limitations under the License.
3636
color: var(--spectrum-dialog-warning-icon-color);
3737
}
3838
}
39-
@media (forced-colors: active) {
40-
.spectrum-Dialog {
41-
border: 1px solid transparent;
42-
}
43-
}

packages/@adobe/spectrum-css-temp/components/modal/index.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ governing permissions and limitations under the License.
2222
/* Distance between top and bottom of dialog and edge of window for fullscreen dialog */
2323
--spectrum-dialog-fullscreen-margin: 40px;
2424
--spectrum-dialog-max-height: calc(var(--spectrum-visual-viewport-height) * 0.9);
25+
26+
--spectrum-dialog-border-size: var(--spectrum-popover-border-size);
2527
}
2628

2729
/* Used to position the modal */
@@ -73,6 +75,7 @@ governing permissions and limitations under the License.
7375
min-width: var(--spectrum-dialog-min-width);
7476

7577
border-radius: var(--spectrum-dialog-border-radius);
78+
border-width: var(--spectrum-dialog-border-size);
7679
outline: none; /* Firefox shows outline */
7780
pointer-events: auto;
7881

@@ -143,3 +146,9 @@ only screen and (max-device-height: 350px) {
143146
transform: none;
144147
}
145148
}
149+
150+
@media (forced-colors: active) {
151+
.spectrum-Modal:not(.spectrum-Modal--fullscreenTakeover) {
152+
border-style: solid;
153+
}
154+
}

packages/@adobe/spectrum-css-temp/components/modal/skin.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ OF ANY KIND, either express or implied. See the License for the specific languag
1010
governing permissions and limitations under the License.
1111
*/
1212

13+
14+
:root {
15+
--spectrum-dialog-border-color: var(--spectrum-alias-border-color-transparent);
16+
}
17+
1318
.spectrum-Modal {
1419
background: var(--spectrum-dialog-background-color);
15-
}
20+
border-color: var(--spectrum-dialog-border-color);
21+
}

packages/@adobe/spectrum-css-temp/components/popover/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@ governing permissions and limitations under the License.
4848

4949
outline: none; /* Hide focus outline */
5050
box-sizing: border-box;
51+
overflow: hidden;
5152

5253
&.is-open {
5354
@inherit: %spectrum-overlay--open;
5455
}
5556
}
5657

58+
.spectrum-Popover--withTip {
59+
overflow: visible;
60+
}
61+
5762
.spectrum-Popover-tip {
5863
position: absolute;
5964
--spectrum-popover-tip-size: var(--spectrum-popover-tip-width);

packages/@adobe/spectrum-css-temp/components/popover/skin.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ governing permissions and limitations under the License.
3737
}
3838
}
3939
}
40+
41+
@media (forced-colors: active) {
42+
.spectrum-Popover {
43+
--spectrum-popover-background-color: Canvas;
44+
--spectrum-popover-border-color: CanvasText;
45+
}
46+
}

packages/@adobe/spectrum-css-temp/components/rule/skin.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@ governing permissions and limitations under the License.
2121
.spectrum-Rule--small {
2222
background-color: var(--spectrum-rule-small-background-color);
2323
}
24+
25+
@media (forced-colors: active) {
26+
.spectrum-Rule {
27+
forced-color-adjust: none;
28+
--spectrum-rule-large-background-color: CanvasText;
29+
--spectrum-rule-medium-background-color: CanvasText;
30+
--spectrum-rule-small-background-color: CanvasText;
31+
}
32+
}

packages/@adobe/spectrum-css-temp/components/tray/index.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@
6363
display: flex;
6464
flex-direction: column;
6565

66+
overflow-x: hidden;
67+
overflow-y: auto;
68+
6669
border-radius: var(--spectrum-tray-full-width-border-radius) var(--spectrum-tray-full-width-border-radius) var(--spectrum-tray-border-radius) var(--spectrum-tray-border-radius);
6770

6871
/* Start offset by the animation distance */
@@ -94,3 +97,10 @@
9497
border-radius: var(--spectrum-tray-border-radius);
9598
}
9699
}
100+
101+
@media (forced-colors: active) {
102+
.spectrum-Tray {
103+
border-width: var(--spectrum-alias-border-size-thin);
104+
border-style: solid solid none;
105+
}
106+
}

packages/@adobe/spectrum-css-temp/vars/express.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,9 @@
162162
.express.large {
163163
--spectrum-switch-track-width: 36px;
164164
}
165+
166+
@media (forced-colors: active) {
167+
.express.express {
168+
--spectrum-popover-border-size: var(--spectrum-alias-border-size-thin);
169+
}
170+
}

0 commit comments

Comments
 (0)