1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-19 11:51:23 +02:00

Icon link: envariable + enhance the documentation (#38130)

* Envariable the icon-link helper

* Proposal

* .
This commit is contained in:
Louis-Maxime Piton
2023-03-02 19:32:43 +01:00
committed by GitHub
parent 912cfe5823
commit 783213691a
3 changed files with 40 additions and 7 deletions

View File

@@ -45,6 +45,14 @@ Add `.icon-link-hover` to move the icon to the right on hover.
</a>
{{< /example >}}
## Customize
Modify the styling of an icon link with our link CSS variables, Sass variables, utilities, or custom styles.
### CSS variables
Modify the `--bs-link-*` and `--bs-icon-link-*` CSS variables as needed to change the default appearance.
Customize the hover `transform` by overriding the `--bs-icon-link-transform` CSS variable:
{{< example >}}
@@ -54,7 +62,22 @@ Customize the hover `transform` by overriding the `--bs-icon-link-transform` CSS
</a>
{{< /example >}}
## Pairs with link utilities
Customize the color by overriding the `--bs-link-*` CSS variable:
{{< example >}}
<a class="icon-link icon-link-hover" style="--bs-link-hover-color-rgb: 25, 135, 84;" href="#">
Icon link
<svg class="bi" aria-hidden="true"><use xlink:href="#arrow-right"></use></svg>
</a>
{{< /example >}}
### Sass
Customize the icon link Sass variables to modify all icon link styles across your Bootstrap-powered project.
{{< scss-docs name="icon-link-variables" file="scss/_variables.scss" >}}
### Utilities
Modify icon links with any of [our link utilities]({{< docsref "/utilities/link/" >}}) for modifying underline color and offset.