Skip to content

Commit 5d6080d

Browse files
committed
live-web-view: Navigation style updates.
1 parent 01eee47 commit 5d6080d

File tree

4 files changed

+17
-4
lines changed

4 files changed

+17
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import live-web.dom
22

33
component NavContentToggle < Div{
4-
classes: ['nav-content-toggle']
4+
classes: ['nav-content', 'nav-content-toggle']
55
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
component NavFixed{
2+
classes: ['nav-fixed']
3+
}

packages/live-web-view/navigation/NavSections.lv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import .overlay
55
component NavSections < Div{
66
id: navSections
77

8-
classes: ['nav-sections', 'cols-' + this.children.length]
8+
classes: ['nav-sections', 'cols-' + this.children.length, 'cols-toggle-' + this.children.filter(c => c.classes.includes('nav-content-toggle')).length]
99
Object data
1010
string active: ''
1111

packages/live-web-view/navigation/style/topnav.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
&TopNav{
2-
@apply flex flex-col justify-between w-full min-h-[3rem] bg-white dark:bg-mono-1 text-[#555] dark:text-mono-e md:items-center;
2+
@apply relative flex flex-col justify-between w-full min-h-[3rem] bg-white dark:bg-mono-1 text-[#555] dark:text-mono-e md:items-center;
33
@apply border-b border-mono-c dark:border-mono-4;
44
}
55
&TopNav&.position-static{
66
@apply static;
77
}
8+
&TopNav .nav-fixed{
9+
@apply fixed w-full h-12;
10+
}
811
&TopNav .nav-content{
912
@apply flex items-center h-full px-4 min-h-[3rem] space-x-1 justify-between md:justify-start;
1013
}
@@ -27,13 +30,20 @@
2730
@apply w-full grid;
2831
}
2932
&TopNav .nav-sections.cols-2{
30-
@apply flex justify-between;
33+
@apply grid;
34+
grid-template-columns: 1fr auto;
35+
}
36+
&TopNav .nav-sections.cols-2.cols-toggle-1{
37+
@apply block md:grid;
3138
}
3239
&TopNav .nav-sections.cols-3{
3340
/* @apply grid grid-cols-3; */
3441
display: grid;
3542
grid-template-columns: 1fr auto 1fr;;
3643
}
44+
&TopNav .nav-sections.cols-3.cols-toggle-1{
45+
@apply grid-cols-2 md:grid-cols-3;
46+
}
3747
&TopNav .nav-sections.cols-3 .nav-content:last-child{
3848
justify-self: end;
3949
}

0 commit comments

Comments
 (0)