Giter VIP home page Giter VIP logo

Comments (4)

benjamincanac avatar benjamincanac commented on June 18, 2024 3

Will look into it!

from ui.

benjamincanac avatar benjamincanac commented on June 18, 2024

There is indeed no active styles defined on the Dropdown links, what would you expect?

from ui.

cco3 avatar cco3 commented on June 18, 2024
  1. Because item.active and item.inactive exist in the UI property.
  2. 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.

zoobzio avatar zoobzio commented on June 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.