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

value_box() style adjustments (top-right and value font size) #1041

Closed
gadenbuie opened this issue Apr 17, 2024 · 2 comments
Closed

value_box() style adjustments (top-right and value font size) #1041

gadenbuie opened this issue Apr 17, 2024 · 2 comments
Assignees

Comments

@gadenbuie
Copy link
Member

Two adjustments I've recently used in an app are:

  1. Have the value of a showcase_layout = "top right" value box take up the entire value box width with

    .bslib-value-box.showcase-top-right .value-box-grid .value-box-area {
      grid-column: 1 / 3;
    }
  2. Use the container query width to drive the value font-size, rather than the viewport width (it currently uses something like font-size: 1.325rem + .9vw).

    .bslib-value-box .value-box-value {
      font-size: calc(1rem + 3cqi);
    }

    With this rule, the width of the value box itself drives the font size of the value, so the value shrinks and grows proportional to the value box width.

@gadenbuie gadenbuie self-assigned this May 24, 2024
@gadenbuie
Copy link
Member Author

The font-size comes from applying Bootstraps h2 and h6 font and spacing styles. I think we should stick with that.

.value-box-title {
@include bootstrap-heading-font-and-spacing($h6-font-size);
// add a non-breaking space to ensure it's not 0 height
&:empty::after {
content: '\00a0 '
}
}
.value-box-value {
@include bootstrap-heading-font-and-spacing($h2-font-size);
// add a non-breaking space to ensure it's not 0 height
&:empty::after {
content: '\00a0 '
}
}

@gadenbuie
Copy link
Member Author

Oh and actually, a better way to approach the width of the top-right showcase is to adjust the showcase width, e.g. showcase = showcase_top_right(width = 0.3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant