Comments (1)
Currently there's a navbar component and it just places items in a row using flexbox. There's also a drawer component which opens an off-canvas sidebar (or shows a fixes sidebar on desktop lg
viewport if you want)
One solution might be dynamically changing the style of navbar
items into a vertical menu and place them in a drawer.
- pros:
- no duplicate HTML for menu items
- cons:
- what actually is happening here is transforming one component to another component.
- there could be anything on a navbar or sidebar drawer. it's not always a simple menu, so it might not the best decision to just put everything from navbar into a vertical drawer for mobile.
The other solution is just having a navbar, hide extra items on mobile resolution. then having a drawer to show the items on mobile. (see example here)
- pros:
- there's no limit. you can put anything on your navbar and your drawer. not only a menu.
- you can control which item should be visible on mobile or desktop (using
hidden
class)
- cons:
- duplicate html for the menu (if you want to show it horizontally on desktop and vertically on mobile)
I'm not strict on this and I'm also looking for the best solution but for now, I think the second solution makes more sense and gives you more control (like this)
from daisyui.
Related Issues (20)
- bug: Invalid theme switch(主题切换无效) HOT 5
- bug: Daisy's CSS not working in Production HOT 2
- bug: Countdown does not work in cdn versions HOT 2
- docs: npm i -D daisyui@latest in the install guide of 3.9.4 HOT 10
- bug: OKLCH colors and themes not working on mobile HOT 8
- bug: error in daisyUi themes HOT 5
- bug: Fallback colors don't use opacity like oklch HOT 1
- bug: Fallback background-colors don't use opacity like oklch HOT 2
- bug: Issue styling tabs with radio tabs HOT 2
- bug: Collapse with icon, Arrow is jumping but plus/minus icon seems ok HOT 2
- bug: vite warnings when minifying css HOT 2
- bug: CDN installation does not recognize submit button HOT 1
- bug: Tab content width on Safari HOT 6
- bug: Divider from tailwindcss has inconsistent color HOT 3
- bug: Right drawer get navigation focus if it has an input HOT 3
- bug: Badge component not responsive (not growing) HOT 2
- bug: Steps with a hidden element HOT 2
- bug: toggle should have a hover state HOT 4
- docs: Button HOT 6
- bug: Carousel of Mobile Mockup does not work. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from daisyui.