Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report][3.1.14] Some of the anchor CSS properties interfere with the <v-btn> styles #17183

Closed
set-killer opened this issue Apr 19, 2023 · 3 comments

Comments

@set-killer
Copy link

Environment

Vuetify Version: 3.1.14
Vue Version: 3.2.47
Browsers: Firefox 112.0
OS: Linux x86_64

Steps to reproduce

So i have defined some CSS properties for anchor active, anchor hover, anchor visited.
Those properties however reflect on the components of type <v-btn>.

Expected Behavior

I expect the <v-btn> styles to not be dependable on the <a> styles because I'm rendering a button, not a link. If i want to render an <a> tag I'll use the <a> tag alone.

Actual Behavior

The <v-btn> uses the style that are defined for the <a> tags.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

Probably adding !important to some of the color css properties would resolve the issue (hopefully).

@KaelWD
Copy link
Member

KaelWD commented Apr 19, 2023

We can't account for every possible combination of custom styles you might apply, you'll have to handle this in your own CSS. Also #15596 somewhat.

If i want to render an <a> tag I'll use the <a> tag alone.

Don't use the href or to props then if you don't want it to render an <a>

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Apr 19, 2023
@set-killer
Copy link
Author

Don't use the href or to props then if you don't want it to render an <a>

Then what should I use? The other option would be to use button with the @click event and then manually reroute the user to the new location. This looks bad...

And also the <a> tags are quite common to use. Not every anchor should be rendered as a button, and not every button should be rendered as an anchor. There should be a clear separation between the buttons and the anchors.

In Vuetify there are already some color css properties related to the buttons. Setting them to !important would resolve this issue. For example:

.v-btn--variant-elevated, .v-btn--variant-flat {
    background: rgb(var(--v-theme-surface));
    color: rgba(var(--v-theme-on-surface),var(--v-high-emphasis-opacity)) !important;
}

@set-killer set-killer changed the title [Bug Report][3.1.14] Some of the ancor CSS properties interfere with the <v-btn> styles [Bug Report][3.1.14] Some of the anchor CSS properties interfere with the <v-btn> styles Apr 19, 2023
@overclocked555
Copy link
Contributor

I use pseudo-class :not()
:not(.v-btn) a {}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants