Skip to content

Commit e26a8cc

Browse files
authored
Fix: Fix icon spacing and snapshot formatting (#1290)
Fix spacing issue caused by upstream Shiny change. Co-authored-by: elnelson575 <elnelson575@users.noreply.github.com>
1 parent c63aea0 commit e26a8cc

14 files changed

+34
-95
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Improvements and bug fixes
44

5+
* Fixed `toolbar_input_button()` alignment and spacing issues. (#1290)
6+
57
* The brand.yml example app (`shiny::runExample("brand.yml", package = "bslib")`) now uses `brand_pluck()` and `brand_has()` from `{brand.yml}`. (#1288)
68

79
# bslib 0.10.0

R/sysdata.rda

1.18 KB
Binary file not shown.

inst/components/dist/components.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/components/scss/toolbar.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@
3232
justify-content: center;
3333
line-height: 1; // Override Bootstrap's line-height to avoid too much vertical space
3434
height: var(--_toolbar-btn-size); // Keep square icon and label + icon button heights consistent
35+
display: flex; // Prevent Shiny from overwriting flex centering
36+
37+
// Remove margins from action button elements
38+
.action-icon,
39+
.action-label {
40+
margin: 0;
41+
}
3542

3643
&.btn-default:not(.btn-primary):not(.btn-secondary):not(.btn-success):not(.btn-danger):not(.btn-warning):not(.btn-info):not(.btn-light):not(.btn-dark) {
3744
background-color: transparent !important;
@@ -67,6 +74,13 @@
6774
}
6875
}
6976

77+
// Add spacing between icon and label in buttons with both
78+
.bslib-toolbar-input-button[data-type="both"] {
79+
.action-icon {
80+
margin-right: 0.35rem;
81+
}
82+
}
83+
7084
// Square icon-only buttons
7185
.bslib-toolbar-input-button[data-type="icon"] {
7286
aspect-ratio: 1;
-4 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.
1.09 KB
Binary file not shown.
2.89 KB
Binary file not shown.
1.27 KB
Binary file not shown.
868 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)