Skip to content

Commit

Permalink
fix: improve hover states and add consistent spacing [UX-161] (#3121)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooper-joe authored and jenniferarnesen committed Feb 26, 2024
1 parent 30a5a27 commit 3f9e667
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 29 deletions.
7 changes: 6 additions & 1 deletion src/AppWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,12 @@ const AppWrapper = () => {
>
<WindowDimensionsProvider>
<OrgUnitsProvider>
<CssVariables colors spacers theme />
<CssVariables
colors
elevations
spacers
theme
/>
<App />
</OrgUnitsProvider>
</WindowDimensionsProvider>
Expand Down
15 changes: 13 additions & 2 deletions src/components/core/styles/IconButton.module.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
.iconButton {
width: var(--spacers-dp32);
height: var(--spacers-dp32);
width: 28px;
height: 28px;
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
background-color: transparent;
border-radius: 5px;
}

.iconButton:hover {
background-color: var(--colors-grey200);
}

.iconButton > span {
Expand All @@ -17,4 +23,9 @@

.icon svg {
display: block;
color: var(--colors-grey700);
}

.iconButton:hover .icon svg {
color: var(--colors-grey900);
}
12 changes: 10 additions & 2 deletions src/components/layers/overlays/styles/AddLayerButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
color: var(--colors-grey900);
cursor: pointer;
user-select: none;
padding: 0px 12px;
width: 100%
padding: 0px;
width: 100%;
}

.content {
Expand All @@ -27,12 +27,20 @@
padding: var(--spacers-dp4) var(--spacers-dp8);
gap: var(--spacers-dp8);
}
.content svg {
color: var(--colors-grey700);
}

.button:hover:enabled,
.button:active {
background-color: var(--colors-grey200);
}

.button:hover:enabled .content svg,
.button:active .content svg {
color: var(--colors-grey900);
}

.button:focus {
outline: 3px solid var(--theme-focus);
outline-offset: -3px;
Expand Down
28 changes: 23 additions & 5 deletions src/components/layers/overlays/styles/Layer.module.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,56 @@
.container {
float: left;
width: 120px;
margin-right: var(--spacers-dp16);
width: 128px;
margin-right: var(--spacers-dp4);
margin-bottom: var(--spacers-dp4);
padding: var(--spacers-dp4);
cursor: pointer;
box-sizing: border-box;
height: 160px;
height: auto;
background-color: transparent;
border-radius: 3px;
}
.container:hover {
background-color: var(--colors-grey100);
}

.image {
box-sizing: border-box;
border: 1px solid var(--colors-grey400);
width: 120px;
height: 120px;
border-radius: 2px;
}
.container:hover .image {
border-color: var(--colors-grey500);
}

.noImage {
box-sizing: border-box;
border: 1px solid var(--colors-grey400);
width: 120px;
height: 120px;
border-radius: 2px;
line-height: 120px;
background: var(--colors-grey200);
color: var(--colors-grey500);
color: var(--colors-grey600);
font-size: 12px;
text-align: center;
margin-bottom: var(--spacers-dp4);
}
.container:hover .noImage {
border-color: var(--colors-grey500);
}

.name {
font-size: 14px;
color: var(--colors-grey800);
padding-bottom: 20px;
padding-bottom: var(--spacers-dp4);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
text-align: center;
}
.container:hover .name {
color: var(--colors-grey900);
}
4 changes: 2 additions & 2 deletions src/components/layers/overlays/styles/LayerList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
}

.list {
max-width: 696px;
max-width: 684px;
max-height: calc(100vh - 150px);
padding: var(--spacers-dp16) 0 0 var(--spacers-dp16);
padding: var(--spacers-dp8) var(--spacers-dp12);
overflow-y: auto;
}

Expand Down
12 changes: 6 additions & 6 deletions src/components/layers/styles/LayerCard.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.card {
position: relative;
margin: var(--spacers-dp8) var(--spacers-dp4) -4px var(--spacers-dp4);
margin: var(--spacers-dp4) var(--spacers-dp4) -2px var(--spacers-dp4);
padding-bottom: 0;
z-index: 1200;
}
Expand Down Expand Up @@ -53,10 +53,10 @@

.expand {
position: absolute;
top: 4px;
right: -4px;
width: 48px;
height: 48px;
top: 11px;
right: 2px;
width: 32px;
height: 32px;
padding: 12px;
cursor: pointer;
}
Expand All @@ -68,7 +68,7 @@
.collapsibleContent {
max-height: 0px;
overflow: hidden;
transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
transition: max-height 0.2s ease;
}

.expanded .collapsibleContent {
Expand Down
5 changes: 2 additions & 3 deletions src/components/layers/styles/LayersPanel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
}

.layersPanelInner {
background-color: #f4f6f8;
border-right: 1px solid #e0e0e0;
box-shadow: 1px 0 1px 0 rgba(0, 0, 0, 0.2);
background-color: var(--colors-grey200);
border-right: 1px solid var(--colors-grey400);
height: 100%;
overflow-y: auto;
z-index: 1190;
Expand Down
8 changes: 6 additions & 2 deletions src/components/layers/styles/LayersToggle.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@
padding: var(--spacers-dp8) 0;
color: var(--colors-grey600);
background-color: var(--colors-white);
box-shadow: 3px 1px 5px -1px rgba(0, 0, 0, 0.2);
box-shadow: var(--elevations-e100);
z-index: 1100;
cursor: pointer;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}

.layersToggle.collapsed {
left: 0;
}

.layersToggle:hover {
background-color: var(--colors-grey100);
background-color: var(--colors-grey050);
color: var(--colors-grey900);
box-shadow: var(--elevations-e200);
}
9 changes: 8 additions & 1 deletion src/components/layers/styles/SortableHandle.module.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
.handle {
position: absolute;
left: var(--spacers-dp4);
top: var(--spacers-dp16);
top: 15px;
width: 24px;
height: 24px;
border-radius: 3px;
color: var(--colors-grey600);
cursor: ns-resize;
}
.handle:hover {
background-color: var(--colors-grey200);
color: var(--colors-grey900);
}
4 changes: 2 additions & 2 deletions src/components/layers/toolbar/styles/LayerToolbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
position: relative;
height: var(--spacers-dp32);
min-height: var(--spacers-dp32);
padding: 0 var(--spacers-dp8);
padding: 2px var(--spacers-dp8);
border-top: 1px solid var(--colors-grey300);
color: var(--colors-grey600);
}

.spacer {
float: left;
height: var(--spacers-dp32);
height: 28px;
width: var(--spacers-dp8);
}

Expand Down
18 changes: 15 additions & 3 deletions src/components/layers/toolbar/styles/OpacitySlider.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.container {
width: 100px;
height: var(--spacers-dp32);
height: 28px;
display: flex;
justify-content: center;
align-items: center;
Expand All @@ -17,23 +17,35 @@
cursor: pointer;
}

.slider:disabled {
cursor: not-allowed;
}

.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 12px;
height: 12px;
background: var(--colors-grey600);
background: var(--colors-grey700);
border-radius: 50%;
}

.slider::-moz-range-thumb {
width: 12px;
height: 12px;
background: var(--colors-grey600);
background: var(--colors-grey700);
border: 0;
border-radius: 50%;
}

.slider::-webkit-slider-thumb:hover {
background: var(--colors-grey900);
}

.slider::-moz-range-thumb:hover {
background: var(--colors-grey900);
}

.slider::-moz-focus-outer {
border: 0;
}
Expand Down

0 comments on commit 3f9e667

Please sign in to comment.