Skip to content

Commit 79254cc

Browse files
feat(layout): improve styles
1 parent 0f15f8b commit 79254cc

13 files changed

Lines changed: 54 additions & 25 deletions

File tree

packages/layout/src/assets/css/components/layout/header.css

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
1px solid var(--border-color, #e5e7eb)
1111
);
1212
--_layout-header-max-width: var(--dz-layout-header-max-width, 1920px);
13-
--_layout-header-logo-max-width: var(
14-
--dz-layout-header-logo-max-width,
15-
150px
16-
);
13+
--_layout-header-logo-max-width: var(--dz-layout-header-logo-max-width, 8rem);
1714
--_layout-header-gap: var(--dz-layout-header-gap, 1.5rem);
1815

1916
background: var(--_layout-header-bg);

packages/layout/src/assets/css/components/layout/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
@import "./layout.css";
55
@import "./logo.css";
66
@import "./sidebar.css";
7+
@import "./sticky-collapsible-footer.css";
8+
@import "./toggle-menu.css";
79
@import "./vars.css";
8-
@import "./sticky-collapsible-footer.css"

packages/layout/src/assets/css/components/layout/logo.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.dz-layout .dz-logo {
2-
--_layout-logo-max-width: var(--dz-layout-logo-max-width, 150px);
2+
--_layout-logo-max-width: var(--dz-layout-logo-max-width, 8rem);
33
}
44

55
.dz-layout .dz-logo img {

packages/layout/src/assets/css/components/layout/sidebar.css

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
--_layout-sidebar-color: var(--dz-layout-sidebar-color, #2c2c2c);
1010
--_layout-sidebar-collapsed-width: var(
1111
--dz-layout-sidebar-collapsed-width,
12-
1.2rem
12+
0
1313
);
1414
--_layout-sidebar-logo-max-width: var(
1515
--dz-layout-sidebar-logo-max-width,
16-
6.75rem
16+
8rem
1717
);
1818
--_layout-sidebar-padding-h: var(--dz-layout-sidebar-padding-h, 1.5rem);
1919
--_layout-sidebar-padding-v: var(--dz-layout-sidebar-padding-v, 1rem);
@@ -63,8 +63,7 @@
6363
overflow-x: hidden;
6464
}
6565

66-
.dz-layout > .dz-sidebar > :not(.dz-sidebar-header),
67-
.dz-layout > .dz-sidebar[data-header="false"] > :not(.dz-snavigation-menu) {
66+
.dz-layout > .dz-sidebar > :not(.dz-sidebar-header):not(.dz-navigation-menu) {
6867
border-top: 1px solid var(--_layout-sidebar-separator-color);
6968
}
7069

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.dz-layout .dz-toggle-menu {
2+
--_background-color: var(--dz-secondary-color);
3+
4+
border-radius: 50%;
5+
cursor: pointer;
6+
height: 2.875rem;
7+
line-height: 1;
8+
padding: 0.75rem;
9+
text-align: center;
10+
width: 2.875rem;
11+
transition: background-color var(--transition-duration) ease;
12+
}
13+
14+
.dz-layout .dz-toggle-menu:hover {
15+
background-color: color-mix(in srgb, var(--_background-color) 10%, white);
16+
}
17+
.dz-layout .dz-toggle-menu:focus {
18+
background-color: color-mix(in srgb, var(--_background-color) 10%, white);
19+
}
20+
.dz-layout .dz-toggle-menu:active {
21+
background-color: color-mix(in srgb, var(--_background-color) 20%, white);
22+
}
23+
24+
.dz-layout .dz-toggle-menu > i {
25+
font-size: 1.25rem;
26+
}

packages/layout/src/assets/css/components/layout/vars.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
:root {
2-
--dz-layout-logo-max-width: 6.75rem;
2+
--dz-layout-logo-max-width: 8rem;
33

44
--dz-layout-sidebar-bg: white;
55
--dz-layout-sidebar-border: 1px solid var(--border-color, #e5e7eb);
6+
--dz-layout-sidebar-collapsed-width: 0;
67
--dz-layout-sidebar-color: var(--color, #374151);
78
--dz-layout-sidebar-logo-max-width: var(--dz-layout-logo-max-width);
89
--dz-layout-sidebar-padding-h: 1.5rem;
@@ -24,7 +25,7 @@
2425
--dz-layout-header-border: 1px solid var(--border-color, #e5e7eb);
2526
--dz-layout-header-color: var(--color, #374151);
2627
--dz-layout-header-gap: 1.5rem;
27-
--dz-layout-header-logo-max-width: 120px;
28+
--dz-layout-header-logo-max-width: var(--dz-layout-logo-max-width);
2829
--dz-layout-header-max-width: 1920px;
2930
--dz-layout-header-padding-h: var(--dz-layout-main-padding-h, 1rem);
3031
--dz-layout-header-padding-v: 0.5rem;

packages/layout/src/assets/css/layouts/header-layout.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
grid-area: header;
1515
}
1616

17+
.dz-header-layout > header > .dz-header-container > .dz-toggle-menu {
18+
margin-right: -0.75rem;
19+
}
20+
1721
.dz-header-layout > main {
1822
grid-area: main;
1923
max-width: 100%;

packages/layout/src/assets/css/layouts/sidebar-header-layout.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
display: none;
1111
}
1212

13+
.dz-sidebar-header-layout > header > .dz-header-container > .dz-toggle-menu,
14+
.dz-sidebar-header-layout > .dz-sidebar > .dz-sidebar-header > .dz-toggle-menu {
15+
margin-right: -0.75rem;
16+
}
17+
1318
.dz-sidebar-header-layout > .dz-sidebar {
1419
grid-area: header;
1520
}
@@ -43,6 +48,7 @@
4348

4449
.dz-sidebar-header-layout > header > .dz-header-container > .dz-toggle-menu {
4550
display: block;
51+
margin-left: -0.75rem;
4652
}
4753

4854
.dz-sidebar-header-layout > .dz-sidebar {

packages/layout/src/assets/css/layouts/sidebar-only-layout.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
width: 100%;
77
}
88

9+
.dz-sidebar-only-layout > header > .dz-header-container > .dz-toggle-menu {
10+
margin-right: -0.75rem;
11+
}
12+
913
.dz-sidebar-only-layout > .dz-sidebar {
1014
grid-area: header;
1115
}

packages/layout/src/components/Layout/Header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ export const Header = ({
3939
const renderContent = () => {
4040
return (
4141
<>
42-
{!noLogo && <Logo />}
4342
{!noToggle && <ToggleMenuMobile />}
43+
{!noLogo && <Logo />}
4444
{title && <HeaderTitle title={title} />}
4545
{headerAddon && headerAddon}
4646
{navigationMenu && (

0 commit comments

Comments
 (0)