Button links with text state colors
See original GitHub issue
Curious about community need / interest in this feature. I often use
btn-link
buttons and want to be able to color the buttons per the text state colors provided by Bootstrap. I have found it intuitive to try class="btn-link text-danger"
for a delete link button, to no avail.
I now accomplish this by adding the below to my Bootstrap override LESS file. I feel something like this should ship with Bootstrap. What do the maintainers and the community think?
.btn-link {
&.text-success {
.text-emphasis-variant(@state-success-text);
}
&.text-info {
.text-emphasis-variant(@state-info-text);
}
&.text-warning {
.text-emphasis-variant(@state-warning-text);
}
&.text-danger {
.text-emphasis-variant(@state-danger-text);
}
&.text-muted {
.text-emphasis-variant(@text-muted);
}
}
Issue Analytics
- State:
- Created 9 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
Customize Css button links color - Stack Overflow
I'm creating clickable CSS buttons for my website and want a green button with a white text. But my default link color (blue)...
Read more >HTML Link Colors - W3Schools
An unvisited link is underlined and blue; A visited link is underlined and purple; An active link is underlined and red. You can...
Read more >How To Use Links and Buttons with State Pseudo-Classes in ...
Start by opening up styles.css in your text editor. Create a new class selector called .button . The styles here will redefine many...
Read more >How to change the color of links on a web page
HTML body tag example ; TEXT = The color of text. ; LINK = The color of links. ; VLINK = Visited link...
Read more >How to Change Link Colors with CSS - W3docs
Add the style attribute directly to the hyperlink code and specify the color property through the style attribute, then give a color value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As mentioned in the docs, just use a wrapper span:
<button class="btn btn-link"><span class="text-danger">Your text</span></button>
just had the same issue, updated example for bootstrap 4 / sass: