-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Button that behaves / looks like link #1583
Button that behaves / looks like link #1583
Comments
@tony Is this what you are looking for? <a class="button is-link">Link</a> See https://bulma.io/documentation/elements/button/#colors for more information. |
Bulma's Bulma's Bootstrap's An example use case for this is when a backend requires a form submission (such as a session-based form wizard), but you want the back object to only show as a text link (not a button). The only other way around that would be to use a link and begin wiring in JavaScript to simulate a form submission when a link is clicked. |
I agree with @tony, Very useful feature regarding to UX as a link can be very difficult to click because of the small size. |
This would also be useful for a11y reasons. Anchor tags require hrefs to be keyboard accessible. If you have a link without an href then it would be nice to make it a button that looks like a link |
I've been using button tag with link styling in bulma with the following modifiers:
|
This would be very useful. Any progress? |
Any Progress on this one? In the short term I've created my own .btn-link class which seeks to resolve this for my theme locally. That being said, it would be nice to have this functionality straight from the source. |
I would also appreciate such a feature. I quite often have a Fontawesome icon that should trigger some action on mouse-click and that I want to style like a hyperlink, i.e. hyperlink color, mouse cursor, mouse-over effect, without having a button look-and-feel. Maybe as a side-question: Is there already a button style that just renders a Fontawesome icon and nothing else? No, button border, no button background? |
I'm using something like this, if helpful to anyone. Could def be improved, I'm sure. // A button that looks like a link. Useful for JS-only actions.
.button-link {
font-weight: 400;
color: $link;
background-color: transparent;
border-color: transparent;
&:hover {
color: $link-hover;
text-decoration: underline;
background-color: transparent;
border-color: transparent;
}
&:focus {
text-decoration: underline;
border-color: transparent;
box-shadow: none;
}
// Remove all padding and height so it's just plain, unpadded text.
&.button-text {
padding: 0;
height: unset;
}
} |
Thanks @getup8 for your code snippet. However, in my case, I am new to frontend programming (backend guy here). I do not use SASS and also try to use as little CSS as possible. That's why I love Bulma so much. |
I used this and I thought I'd post it here as an additional workaround.
|
The disadvantage of
and only a single additional CSS rule:
This also works in combination with color modifiers like |
Similar bootstrap behavior of
.btn-link
. Example:Docs: https://getbootstrap.com/docs/4.0/components/buttons/
Source: https://github.com/twbs/bootstrap/blob/1a4a94bfd90626bdd48cea0c0d4bf0293f052edb/scss/_buttons.scss
This is helpful in cases of "back" buttons in form wizards, where forms need to be submitted when traversing form steps.
The text was updated successfully, but these errors were encountered: