Skip to content

Commit 5e80bd6

Browse files
committed
focus
1 parent 072f5fd commit 5e80bd6

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

src/pg/menuItem/menuItem.css

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
}
44

55
[part=label] {
6+
outline: none;
67
display: flex;
78
align-items: center;
89
font-family: var(--pg-font-family);
@@ -25,21 +26,41 @@
2526
}
2627

2728
[part=label]:not(:disabled):active {
28-
background: #2B9CFF;
29+
background: var(--pg-menu-item-active-background, #5f516e);
2930
}
3031

3132
[part=label]:disabled {
32-
color: #BBBBBB;
33+
color: var(--pg-menu-item-disabled-color, rgb(69, 60, 79, 0.75));
3334
}
3435

3536
[part=label].checked::before {
3637
position: absolute;
3738
translate: -1.5rem 0;
38-
content: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.4999,10.2501L 10.5,17.25L 6.49999,13.25L 7.9142,11.8358L 10.5,14.4216L 16.0857,8.83584L 17.4999,10.2501 Z' fill='white' /></svg>");
39+
content: var(--pg-menu-item-check, url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z' fill='rgb(69, 60, 79)' /></svg>"));
3940
width: 1.5rem;
4041
height: 1.5rem;
4142
}
4243

44+
[part=label].checked:hover::before {
45+
content: var(--pg-menu-item-hover-check, url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z' fill='white' /></svg>"));
46+
}
47+
4348
[part=label].checked:disabled::before {
44-
content: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.4999,10.2501L 10.5,17.25L 6.49999,13.25L 7.9142,11.8358L 10.5,14.4216L 16.0857,8.83584L 17.4999,10.2501 Z' fill='rgb(187, 187, 187)' /></svg>");
49+
content: var(--pg-menu-item-hover-check, url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.5,10.2501L 10.5,17.25L 6.5,13.25L 7.9,11.8L 10.5,14.4L 16.0857,8.8L 17.5,10.25Z' fill='rgb(69, 60, 79, 0.5)' /></svg>"));
50+
}
51+
52+
[part=label]:focus {
53+
position: relative;
54+
}
55+
56+
[part=label]:focus::after {
57+
pointer-events: none;
58+
content: '';
59+
position: absolute;
60+
top: -1px;
61+
right: -1px;
62+
bottom: -1px;
63+
left: -1px;
64+
border-radius: 0.25rem;
65+
box-shadow: 0 0 0 3px var(--pg-focus-color, rgb(79, 143, 249, 0.5));
4566
}

src/theme-ui3.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@
2222
--pg-menu-item-color: #FFFFFF;
2323
--pg-menu-item-background: transparent;
2424
--pg-menu-item-selected-background: #248BE5;
25+
--pg-menu-item-disabled-color: #BBBBBB;
26+
--pg-menu-item-check: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.4999,10.2501L 10.5,17.25L 6.49999,13.25L 7.9142,11.8358L 10.5,14.4216L 16.0857,8.83584L 17.4999,10.2501 Z' fill='white' /></svg>");
27+
--pg-menu-item-hover-check: url("data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M 17.4999,10.2501L 10.5,17.25L 6.49999,13.25L 7.9142,11.8358L 10.5,14.4216L 16.0857,8.83584L 17.4999,10.2501 Z' fill='rgb(187, 187, 187)' /></svg>");
28+
--pg-menu-item-active-background: #2B9CFF;
2529
}

0 commit comments

Comments
 (0)