Comments (4)
Will look into it!
from ui.
There is indeed no active styles defined on the Dropdown links, what would you expect?
from ui.
- Because
item.active
anditem.inactive
exist in the UI property. - Because VerticalNavigation is a very similar component and it works this way.
If I have a dropdown that has a Settings
link, but the user is already on the settings page, I would like to communicate that with something more than just disabled
. I'd like to communicate it exactly as I do in the VerticalNavigation (with the active style).
from ui.
I took a look at this issue and it appears that there were two problems in play. In the reproduction you linked, I was able to get some of your styling to be applied by adding dark:
variants to the UI definition:
const ui = {
active: 'before:bg-red-500 bg-red-500 dark:before:bg-red-500 dark:bg-red-500',
inactive:
'hover:before:bg-red-500 hover:bg-red-500 dark:hover:before:bg-red-500 dark:hover:bg-red-500',
};
This works, but it applies inactive
styling to every item even if the item matched the active page. I took a look at the source and determined that I could pass a variable from the parent NuxtLink
component and it would provide the functionality you were looking for without modifying the existing behavior.
I opened a PR to address the issue, but I believe the UI definitions would still need dark variants to function as expected. I am unsure if this is expected functionality of the functions that merge the tailwind classes or if a separate issue should be opened to investigate.
from ui.
Related Issues (20)
- [Feature] Make Nuxt UI easy to integrate with Storybook
- How validation hides errors for not yet used fields HOT 1
- Form `setErrors` clobbers existing errors
- How can I access the items property in a dropdown component? HOT 1
- Button vertical align with icon HOT 1
- Divider without label, icon or avatar HOT 2
- failed to index tailwind config colors using appConfig ui colors HOT 1
- Table loading shifts everything below of 1px
- Updating to >2.15.0 breaks Dropdowns on touch devices when drag and drop libraries are used HOT 4
- Nuxt UI Pro requires license key for unit tests HOT 2
- autofocus on input fields HOT 4
- Docs: Wrong Github Link - BlogPost HOT 1
- Support form validation from OpenAPI schema definitions HOT 1
- Vertical side for `Slideover`component HOT 1
- Dynamically fetched primary colors HOT 3
- Icons are excluded from build when their names are stored outside the SFC (e.g. a `.ts` file) HOT 1
- Feat: Being able to stop the propagation of an event on dropdown button HOT 3
- Type of the data in the row slot HOT 1
- Filter options to only show items that start with the input value for USelectMenu HOT 1
- node_modules/@nuxt/ui/dist/runtime/ui.css is causing issue for text Selection
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 ui.