Skip to content

Commit 2d1df00

Browse files
committed
refactor: misc UI bug fixes and cleanup relating to theme / layout variations / responsive behavior. add missing light theme interactive states to link styles. also globally improves focus state styles so outlines don't spill out / get cut off by other components
1 parent 2a539f5 commit 2d1df00

File tree

4 files changed

+65
-73
lines changed

4 files changed

+65
-73
lines changed

packages/uikit-workshop/src/sass/scss/01-abstracts/_mixins.scss

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
transition: background-color $pl-animate-quick ease-out,
3838
color $pl-animate-quick ease-out;
3939
cursor: pointer;
40+
outline-offset: -3px;
41+
outline-width: 2px;
4042

4143
&:hover {
4244
color: $pl-color-white;
@@ -57,6 +59,15 @@
5759
.pl-c-body--theme-light & {
5860
background-color: $pl-color-white;
5961
color: $pl-color-gray-70;
62+
63+
&:hover {
64+
background-color: $pl-color-gray-07;
65+
}
66+
67+
&:active,
68+
&:focus {
69+
background-color: $pl-color-gray-13;
70+
}
6071
}
6172

6273
/**
@@ -100,9 +111,9 @@
100111
}
101112
}
102113

103-
@mixin noSelect(){
104-
-webkit-user-select: none; /* Chrome all / Safari all */
105-
-moz-user-select: none; /* Firefox all */
106-
-ms-user-select: none; /* IE 10+ */
107-
user-select: none; /* Likely future */
114+
@mixin noSelect() {
115+
-webkit-user-select: none; /* Chrome all / Safari all */
116+
-moz-user-select: none; /* Firefox all */
117+
-ms-user-select: none; /* IE 10+ */
118+
user-select: none; /* Likely future */
108119
}

packages/uikit-workshop/src/sass/scss/04-components/_navigation.scss

Lines changed: 44 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,41 @@
1010
.pl-c-nav {
1111
background-color: inherit;
1212

13-
@media all and (max-width: $pl-bp-med) {
14-
position: absolute;
15-
top: 100%;
16-
width: 100%;
17-
overflow: hidden;
18-
max-height: 0; /* 1 */
19-
display: flex;
20-
flex-direction: column;
21-
transition: max-height $pl-animate-quick ease-out;
13+
position: absolute;
14+
top: 100%;
15+
width: 100%;
16+
overflow: hidden;
17+
max-height: 0; /* 1 */
18+
display: flex;
19+
flex-direction: column;
20+
transition: max-height $pl-animate-quick ease-out;
2221

23-
/**
24-
* Active navigaiton
25-
* 1) Slide
26-
* 2) Set the height to the vierport height minus the height
27-
* of the header
28-
*/
29-
&.pl-is-active {
30-
max-height: 50rem; /* 1 */
31-
height: calc(100vh - #{$offset-top}); /* 2 */
32-
overflow: auto;
33-
@include hideScrollBar();
22+
/**
23+
* Active navigaiton
24+
* 1) Slide
25+
* 2) Set the height to the vierport height minus the height
26+
* of the header
27+
*/
28+
&.pl-is-active {
29+
@include hideScrollBar;
30+
max-height: calc(100vh - #{$offset-top - 1rem}); /* 2 */
31+
overflow: auto;
32+
33+
box-shadow: 0 1px 1px $pl-color-black;
34+
35+
.pl-c-body--theme-light & {
36+
box-shadow: 0 1px 1px darken($pl-color-gray-20, 15%);
3437
}
3538
}
3639

3740
@media all and (min-width: $pl-bp-med) {
38-
display: flex;
41+
flex-direction: row;
42+
position: relative;
43+
top: auto;
44+
width: auto;
45+
overflow: visible;
46+
max-height: none;
47+
box-shadow: none;
3948
}
4049
}
4150

@@ -51,13 +60,11 @@
5160
padding: 0;
5261
list-style: none;
5362
flex-shrink: 0; // helps prevent top-level nav items from occasionally wrapping to multiple lines
54-
55-
@media all and (max-width: $pl-bp-med) {
56-
order: 2; /* 3 */
57-
}
63+
order: 2;
5864

5965
@media all and (min-width: $pl-bp-med) {
6066
display: flex; /* 2 */
67+
order: 1;
6168

6269
// workaround to Firefox-specific flexbox quirk
6370
.pl-c-body--theme-sidebar & {
@@ -72,6 +79,9 @@
7279
.pl-c-nav__item {
7380
cursor: pointer;
7481
position: relative;
82+
display: flex;
83+
flex-direction: column;
84+
justify-content: center; // vertically align nav items
7585
}
7686

7787
/**
@@ -108,6 +118,7 @@
108118
* Nav link
109119
*/
110120
.pl-c-nav__link--dropdown {
121+
flex-grow: 1; // fill up extra space in parent nav item, if available
111122
/**
112123
* Dropdown caret after accordion handle
113124
*/
@@ -141,8 +152,6 @@
141152
*/
142153
&:after {
143154
color: $pl-color-gray-50;
144-
-webkit-transform: rotate(180deg);
145-
-ms-transform: rotate(180deg);
146155
transform: rotate(180deg);
147156
}
148157
}
@@ -182,7 +191,14 @@
182191
*/
183192
.pl-c-nav__sublist--dropdown.pl-is-active {
184193
@media all and (min-width: $pl-bp-med) {
185-
height: calc(100vh - #{$offset-top}); /* 1 */
194+
height: auto;
195+
max-height: calc(100vh - #{$offset-top} - 1rem); /* 1 */
196+
}
197+
198+
border: 1px solid $pl-color-black;
199+
200+
.pl-c-body--theme-light & {
201+
border: 1px solid $pl-color-gray-20;
186202
}
187203
}
188204

packages/uikit-workshop/src/sass/scss/05-themes/_light-theme.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
/**
5050
* All Nav links inside of subnav dropdown
5151
*/
52-
.pl-c-nav__sublist .pl-c-nav__link {
53-
border-left: 1px solid $pl-color-gray-20;
54-
border-right: 1px solid $pl-color-gray-20;
55-
}
5652

5753
/**
5854
* Last sublist item
@@ -61,7 +57,6 @@
6157
@media all and (min-width: $pl-bp-med) {
6258
border-bottom-left-radius: $pl-border-radius-med;
6359
border-bottom-right-radius: $pl-border-radius-med;
64-
border-bottom: 1px solid $pl-color-gray-20;
6560
}
6661
}
6762

packages/uikit-workshop/src/sass/scss/05-themes/_sidebar-theme.scss

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#SIDEBAR THEME
33
\*------------------------------------*/
44

5-
65
@media all and (min-width: $pl-bp-med) {
76
/**
87
* A theme that places displays the header as a sidebar
@@ -61,15 +60,6 @@
6160
order: 2; /* 2 */
6261
}
6362

64-
/**
65-
* Nav link
66-
*/
67-
.pl-c-nav__link {
68-
font-size: $pl-font-size-sm-2;
69-
padding-left: 0;
70-
padding-right: 0;
71-
}
72-
7363
/**
7464
* Nav sublist
7565
*/
@@ -106,11 +96,6 @@
10696
* Dropdown sublist
10797
* 1) Undo fixed height
10898
*/
109-
.pl-c-nav__sublist--dropdown.pl-is-active {
110-
@media all and (min-width: $pl-bp-med) {
111-
height: auto; /* 1 */
112-
}
113-
}
11499

115100
/**
116101
* Nav sub sub list
@@ -164,15 +149,6 @@
164149
display: none;
165150
}
166151

167-
/**
168-
* Dynamically added wrapper around typeahead input
169-
* 1) Have to use important to override JS-added inline styles
170-
*/
171-
.pl-c-header .twitter-typeahead {
172-
display: block !important; /* 1 */
173-
margin-bottom: 0.5rem;
174-
}
175-
176152
/**
177153
* Tools toggle button
178154
*/
@@ -194,17 +170,11 @@
194170
}
195171

196172
/**
197-
* Tools action
198-
*/
199-
.pl-c-tools__action {
200-
}
201-
202-
/**
203-
* Modal
204-
* 1) Position modal (that contains all the content)
205-
* so it fits in remaining available space
206-
* TODO: revisit to find ways to resize
207-
*/
173+
* Modal
174+
* 1) Position modal (that contains all the content)
175+
* so it fits in remaining available space
176+
* TODO: revisit to find ways to resize
177+
*/
208178
.pl-c-modal {
209179
right: 0; /* 1 */
210180
width: auto;

0 commit comments

Comments
 (0)