Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@
width: $button-size-small !important;
margin: 0 !important;
}

&:focus::before {
right: $grid-unit-05 !important;
}
}

// Match the parent selector button.
Expand Down Expand Up @@ -158,10 +154,6 @@
width: 0 !important;
height: 0 !important;
}

&:focus::before {
right: $grid-unit-05 !important;
}
}

// Parent selector overrides
Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/toolbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@
}

// Ensure the icon buttons remain square.
&.has-icon {
// This needs specificity.
&.has-icon.has-icon {
Copy link
Member

Choose a reason for hiding this comment

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

What's the double class for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Short answer: it incrementally increases the specificity of this rule.

Longer answer, it adds specificity to override this inherited padding:

Screenshot 2021-06-28 at 14 29 56

This wasn't necessary in the past, since the icon was centered inside the 48x48 button. But once you add text, such as in reusable blocks, that lower padding will be leveraged. By setting higher specificity and bigger padding, we get it right:

Screenshot 2021-06-28 at 14 30 46

Much longer answer: the block toolbar works decently as is. But having grown organically from features across the years, the CSS is at a level of complexity where it'd be nice to revisit it in a refactor.

// Reduce the default padding when a button only has an icon.
padding-left: $grid-unit-10;
padding-right: $grid-unit-10;
padding-left: $grid-unit-15;
padding-right: $grid-unit-15;
min-width: $block-toolbar-height;
justify-content: center;
}

// @todo: We should extract the tabs styles to the tabs component itself
Expand Down