-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Since v4.4.0, dropdown-item with "active" class without href attribute have black text on hover #30726
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
Comments
I can reproduce this with the latest v4-dev too, I didn't check the master branch /CC @MartijnCuppens |
I think in this case, since you're not using an |
In theory, a link without href is valid and can be used like in the demo provided. We could do a:not([href]):not([class]) {
&,
&:hover,
&:focus {
&:hover {
color: inherit;
text-decoration: none;
}
} which only removes the styles from links without href and class. |
I'm okay with the not class addition there... it'd at least fix issues where things overlap with our components. |
Hi @MartijnCuppens and @mdo, since Bootstrap 4.5.1, all my color links can't be overridden because you add a:not([href]),
a:not([href]):not([class]) {
&,
&:hover,
&:focus {
&:hover {
color: inherit;
text-decoration: none;
}
}
} For example, I can't color all my links once and add a custom class for each link separately: <div class="text-muted">
<a class="hover-success" (click)="add()"> <--- since I have a class on the `<a>` my `text-muted` class on the `div` can't be applied, I need to add it to all my links with 4.5.1 :/
<fa-icon [icon]="['fas', 'plus']"></fa-icon>
</a>
<a class="hover-primary" (click)="edit()">
<fa-icon [icon]="['fas', 'pencil-alt']"></fa-icon>
</a>
<a class="hover-warning" (click)="viewHistory()">
<fa-icon [icon]="['fas', 'history']"></fa-icon>
</a>
<a class="hover-danger" (click)="delete()">
<fa-icon [icon]="['fas', 'trash-alt']"></fa-icon>
</a>
</div> What do you think? |
@Jukien, you should use a button instead of an |
@MartijnCuppens thank you for your help. You're right. |
And break things, where it does not overlap with Bootstrap components. I really don't understand how it makes sense that:
and
Behave differently. If the goal was to fix styling of Bootstrap components the fix should have probably been connected to such components classes, not the global reset styles. |
Windows 10: Chrome, Firefox, IE, Edge
Bootstrap v4.4.1 test case: https://codepen.io/caseyjhol/pen/ExVoYGg
Bootstrap v4.3.1 test case: https://codepen.io/caseyjhol/pen/bGVabzZ
Caused by commit 970c417 (#29140). Obviously a button element could be used instead, but it would potentially require changing a lot of markup, and any existing
a
styling would also have to be applied tobutton
. An emptyhref
tag could also be used, but that's technically invalid HTML. Perhaps an exception for links with the dropdown-item class could be added?The text was updated successfully, but these errors were encountered: