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

Migrating to 3.0: Icon Buttons have extra padding on right side #2769

Closed
cmslewis opened this issue Aug 7, 2018 · 1 comment · Fixed by #2775
Closed

Migrating to 3.0: Icon Buttons have extra padding on right side #2769

cmslewis opened this issue Aug 7, 2018 · 1 comment · Fixed by #2775

Comments

@cmslewis
Copy link
Contributor

cmslewis commented Aug 7, 2018

Environment

  • Package version(s): @blueprintjs/core 3.2.0
  • Browser and OS versions: Max OS X Sierra, Chrome 68.0.3440.84

Steps to reproduce

Buttons with an icon but no text have extra right padding in Blueprint 3.X (and maybe in 2.X too, since that's when the SVG icon refactor occurred?).

Actual behavior

From the Button docs:

screen shot 2018-08-07 at 9 21 37 am
screen shot 2018-08-07 at 9 22 09 am

Expected behavior

image

image

Possible solution

Given that:

  • We'd need to detect when .bp3-button-text is :empty in order to remove the margin-right from the preceding svg element, and
  • CSS selectors don't let you peek ahead like that,

It follows that:

  • A pure CSS solution here would presumably require us to either (1) add a new bp3-button-empty CSS class to the root button element, or (2) move the margin-right on the svg to a margin-left on bp3-button-text, then do this:

    .bp3-icon + .bp3-button-text {
        margin: 7px; // or whatever SCSS variable math yields this value
    }
    
    .bp3-button-text:empty {
        margin-left: 0;
    }

I propose (2).

@giladgray
Copy link
Contributor

oops this is a regression from fixing #2727

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

Successfully merging a pull request may close this issue.

2 participants