-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5392 from solidusio/elia/admin-support
Update the `Spree::Backend` navigation menu to match the upcoming `SolidusAdmin`
- Loading branch information
Showing
20 changed files
with
609 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
backend/app/assets/images/spree/backend/themes/solidus_admin/remixicon.symbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
274 changes: 274 additions & 0 deletions
274
backend/app/assets/stylesheets/spree/backend/components/_navigation_solidus_admin.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,274 @@ | ||
$color-navbar-hover-bg: $color-navbar-bg !default; | ||
$color-navbar-hover: $color-navbar !default; | ||
@import "spree/backend/themes/solidus_admin/colors"; | ||
@import "spree/backend/components/switch_solidus_admin"; | ||
|
||
.solidus-admin--nav { | ||
background-color: $color-light; | ||
position: sticky; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
margin-left: -$width-sidebar; | ||
z-index: $zindex-sticky; | ||
width: $width-sidebar; | ||
padding: 16px; | ||
box-sizing: border-box; | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 100vh; | ||
border-right: $color-light-accent 1px solid; | ||
|
||
&--wrapper { | ||
position: absolute; | ||
top: 0; | ||
bottom: 0; | ||
left: 0; | ||
width: 240px; | ||
} | ||
|
||
@media print { | ||
display: none; | ||
} | ||
|
||
&--section { | ||
text-align: center; | ||
width: 100%; | ||
flex-grow: 0; | ||
flex-shrink: 0; | ||
|
||
&:not(:last-child) { | ||
margin-bottom: 16px; | ||
} | ||
} | ||
|
||
> nav { | ||
flex-grow: 1; | ||
} | ||
|
||
&--logo { | ||
display: flex; | ||
align-items: center; | ||
overflow: hidden; | ||
text-align: left; | ||
margin-bottom: 16px; | ||
padding: 12px 8px; | ||
|
||
img { | ||
max-height: $main-header-height - (16px * 2) - (12px * 2); | ||
} | ||
} | ||
|
||
&--store-link { | ||
display: flex; | ||
width: 100%; | ||
border: $border-color 1px solid; | ||
border-radius: $border-radius; | ||
padding: 6px 8px; | ||
text-align: left; | ||
|
||
&:hover { | ||
background: $color-navbar-hover-bg; | ||
color: $color-navbar-hover; | ||
} | ||
|
||
i { | ||
float: right; | ||
padding: 6px 8px; | ||
color: $color-dark-light; | ||
} | ||
|
||
&--name { | ||
line-height: 24px; | ||
font-size: 14px; | ||
font-weight: 600; | ||
color: $color-dark; | ||
display: block; | ||
} | ||
|
||
&--url { | ||
line-height: 20px; | ||
font-size: 12px; | ||
font-weight: 400; | ||
color: $color-dark-light; | ||
display: block; | ||
} | ||
|
||
svg { | ||
fill: $solidus-admin-gray-400; | ||
height: 16px; | ||
width: 100%; | ||
max-width: 16px; | ||
} | ||
} | ||
|
||
&--menu { | ||
padding: 0; | ||
list-style: none; | ||
text-align: left; | ||
|
||
li { | ||
padding: 0; | ||
} | ||
|
||
li > a, | ||
li > label { | ||
margin: 0; | ||
margin-bottom: 2px; | ||
display: block; | ||
font-size: 14px; | ||
line-height: 24px; | ||
font-weight: 600; | ||
padding: 2px 12px; | ||
width: 100%; | ||
border-radius: $border-radius; | ||
color: $color-primary; | ||
gap: 12px; | ||
display: flex; | ||
align-items: center; | ||
|
||
&::before, | ||
svg { | ||
display: inline-block; | ||
width: 18px; | ||
height: 18px; | ||
padding: 0; | ||
} | ||
} | ||
|
||
li.selected > a { | ||
background: $color-navbar-active-bg; | ||
color: $color-navbar-active; | ||
} | ||
|
||
li:not(.selected):hover > a, | ||
li:not(.selected):hover > label { | ||
background: $color-navbar-hover-bg; | ||
color: $color-navbar-hover; | ||
} | ||
|
||
ul { | ||
padding: 0; | ||
margin: 0; | ||
list-style: none; | ||
|
||
li a { | ||
padding-left: 12px + 18px + 12px; | ||
font-weight: 400; | ||
color: $color-dark-dark; | ||
} | ||
} | ||
|
||
li:not(.selected) > ul { | ||
display: none; | ||
} | ||
} | ||
|
||
&--footer { | ||
position: relative; | ||
width: 100%; | ||
|
||
summary { | ||
display: flex; | ||
padding: 12px; | ||
margin-top: 8px; | ||
gap: 6px; | ||
border-radius: 4px; | ||
color: $solidus-admin-gray-500; | ||
cursor: pointer; | ||
line-height: 0; | ||
align-items: center; | ||
font-size: 14px; | ||
font-weight: 600; | ||
outline: none; | ||
|
||
&:hover { | ||
background-color: $solidus-admin-gray-25; | ||
} | ||
|
||
[open] > & { | ||
background-color: $solidus-admin-gray-25; | ||
} | ||
|
||
&::marker, | ||
&::-webkit-details-marker { | ||
display: none; | ||
} | ||
|
||
svg { | ||
display: inline-block; | ||
flex-shrink: 0; | ||
vertical-align: text-bottom; | ||
width: 24px; | ||
height: 24px; | ||
background-color: $solidus-admin-black; | ||
fill: $solidus-admin-yellow; | ||
border-radius: 100%; | ||
} | ||
|
||
div { | ||
line-height: 24px; | ||
align-self: stretch; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
white-space: nowrap; | ||
} | ||
} | ||
|
||
ul { | ||
font-size: 14px; | ||
position: absolute; | ||
left: 0; | ||
bottom: 100%; | ||
padding: 8px; | ||
margin-bottom: 4px; | ||
border-radius: 8px; | ||
border: 1px $solidus-admin-gray-100 solid; | ||
width: 100%; | ||
color: $solidus-admin-black; | ||
background-color: $solidus-admin-white; | ||
box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, | ||
rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0.08) 0px 4px 8px 0px, | ||
rgba(0, 0, 0, 0.04) 0px 2px 4px -1px; | ||
|
||
li { | ||
display: flex; | ||
align-items: center; | ||
border-radius: 4px; | ||
height: 32px; | ||
padding: 0 8px; | ||
|
||
&:hover { | ||
background-color: $solidus-admin-gray-25; | ||
} | ||
|
||
a, | ||
label { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
color: inherit; | ||
height: 32px; | ||
margin: 0px; | ||
font-size: 1em; | ||
background-color: inherit; | ||
|
||
select { | ||
appearance: none; | ||
border: none; | ||
background-color: transparent; | ||
width: 100%; | ||
flex-grow: 1; | ||
} | ||
|
||
svg { | ||
height: 20px; | ||
width: 100%; | ||
max-width: 20px; | ||
fill: currentColor; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
backend/app/assets/stylesheets/spree/backend/components/_switch_solidus_admin.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
@import "spree/backend/themes/solidus_admin/colors"; | ||
|
||
.solidus-admin--nav--switch { | ||
appearance: none; | ||
cursor: pointer; | ||
width: 2.5rem; | ||
height: 1.5rem; | ||
background: $solidus-admin-gray-200; | ||
display: block; | ||
border-radius: 100px; | ||
position: relative; | ||
|
||
&:focus { | ||
outline: 0; | ||
} | ||
|
||
&:hover { | ||
background-color: $solidus-admin-gray-300; | ||
} | ||
|
||
&:after { | ||
content: ''; | ||
position: absolute; | ||
top: 0.125rem; | ||
left: 0.125rem; | ||
width: 1.25rem; | ||
height: 1.25rem; | ||
background: #fff; | ||
border-radius: 90px; | ||
transition: 0.3s; | ||
} | ||
|
||
&:checked { | ||
background: $solidus-admin-gray-500; | ||
&:after { | ||
left: 2.375rem; | ||
transform: translatex(-100%); | ||
} | ||
|
||
&:hover { | ||
background: $solidus-admin-gray-700; | ||
} | ||
} | ||
|
||
&:active:after { | ||
width: 1.5rem; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.