Skip to content
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

New Sass variable to change vertical rule width #38886

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scss/_variables.scss
Copy link

@simo026q simo026q Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding a new variable called $rule-border-width?

$rule-border-width: var(--#{$prefix}border-width) !default;

$hr-border-width: $rule-border-width !default;
$vr-border-width: $rule-border-width !default;

You could also do the same with the $hr-opacity since you most likely don't know it's used by the vertical rule without looking at the implementation. But that should maybe be another PR

Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ $hr-border-color: null !default; // Allows for inherited colors
$hr-border-width: var(--#{$prefix}border-width) !default;
$hr-opacity: .25 !default;

// scss-docs-start vr-variables
$vr-border-width: var(--#{$prefix}border-width) !default;
// scss-docs-end vr-variables

$legend-margin-bottom: .5rem !default;
$legend-font-size: 1.5rem !default;
$legend-font-weight: null !default;
Expand Down
2 changes: 1 addition & 1 deletion scss/helpers/_vr.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.vr {
display: inline-block;
align-self: stretch;
width: 1px;
width: $vr-border-width;
min-height: 1em;
background-color: currentcolor;
opacity: $hr-opacity;
Expand Down
8 changes: 8 additions & 0 deletions site/content/docs/5.3/helpers/vertical-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,11 @@ They can also be used in [stacks]({{< docsref "/helpers/stacks" >}}):
<div class="p-2">Third item</div>
</div>
{{< /example >}}

## CSS

### Sass variables

Customize the vertical rule Sass variable to change its width.

{{< scss-docs name="vr-variables" file="scss/_variables.scss" >}}