mirror of
https://github.com/twbs/bootstrap.git
synced 2025-03-15 15:29:22 +01:00
Update buttons.md
This commit is contained in:
parent
3515ac16a1
commit
6301ca1ee0
@ -129,7 +129,7 @@ To cover cases where you have to keep the `href` attribute on a disabled link, t
|
||||
|
||||
## Block buttons
|
||||
|
||||
Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button specific classes, we have much greater control over spacing, alignment, and responsive behaviors.
|
||||
Create responsive stacks of full-width, "block buttons" like those in Bootstrap 4 with a mix of our display and gap utilities. By using utilities instead of button-specific classes, we have much greater control over spacing, alignment, and responsive behaviors.
|
||||
|
||||
{{< example >}}
|
||||
<div class="d-grid gap-2">
|
||||
@ -156,7 +156,7 @@ You can adjust the width of your block buttons with grid column width classes. F
|
||||
</div>
|
||||
{{< /example >}}
|
||||
|
||||
Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right align the buttons when they're no longer stacked.
|
||||
Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we've taken our previous responsive example and added some flex utilities and a margin utility on the button to right-align the buttons when they're no longer stacked.
|
||||
|
||||
{{< example >}}
|
||||
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
|
||||
@ -201,8 +201,8 @@ const bsButton = new bootstrap.Button('#myButton')
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| `dispose` | Destroys an element's button. (Removes stored data on the DOM element) |
|
||||
| `getInstance` | Static method which allows you to get the button instance associated to a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. |
|
||||
| `getOrCreateInstance` | Static method which returns a button instance associated to a DOM element or create a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. |
|
||||
| `getInstance` | Static method which allows you to get the button instance associated with a DOM element, you can use it like this: `bootstrap.Button.getInstance(element)`. |
|
||||
| `getOrCreateInstance` | Static method which returns a button instance associated with a DOM element or creates a new one in case it wasn't initialized. You can use it like this: `bootstrap.Button.getOrCreateInstance(element)`. |
|
||||
| `toggle` | Toggles push state. Gives the button the appearance that it has been activated. |
|
||||
{{< /bs-table >}}
|
||||
|
||||
@ -227,7 +227,7 @@ As part of Bootstrap's evolving CSS variables approach, buttons now use local CS
|
||||
|
||||
Each `.btn-*` modifier class updates the appropriate CSS variables to minimize additional CSS rules with our `button-variant()`, `button-outline-variant()`, and `button-size()` mixins.
|
||||
|
||||
Here's an example of building a custom `.btn-*` modifier class like we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables.
|
||||
Here's an example of building a custom `.btn-*` modifier class as we do for the buttons unique to our docs by reassigning Bootstrap's CSS variables with a mixture of our own CSS and Sass variables.
|
||||
|
||||
<div class="bd-example">
|
||||
<button type="button" class="btn btn-bd-primary">Custom button</button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user