question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Button border-width sizing not matching

See original GitHub issue

Bug Report

Ionic version: [x] 4.x

Current behavior: If the ion-button’s fill is set to outline, the border-width is set to 2, while if it is set to fill, the width is 1 or 0 depending on which border. If the style is changed at runtime, the size of the button will change, causing a layout ‘wiggle’

Expected behavior: The border-width’s should match.

Steps to reproduce: Create two buttons, one set to outline and one set to fill. Have the same button text. Measure the width. The heights appear to be equal.

Related code:

Other information: https://ionic-worldwide.slack.com/archives/C03AJVAJT/p1556736362018500

Ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.3.1
   @angular-devkit/build-angular : 0.13.8
   @angular-devkit/schematics    : 7.3.8
   @angular/cli                  : 7.3.8
   @ionic/angular-toolkit        : 1.5.1

System:

   NodeJS : v10.14.2 (/usr/local/bin/node)
   npm    : 6.9.0
   OS     : macOS Mojave

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisgriffithcommented, May 6, 2019

Original Slack Question: https://ionic-worldwide.slack.com/archives/C03AJVAJT/p1556734130017800 Here is the thread:

jtth [11:08 AM] have i lost my mind or is the <ion-button fill="outline"> the exact outline-width wider than fill="solid"

jphambleton [11:28 AM] Like stroke is aligned to outer?

jtth [11:46 AM] yeah it’s like a pixel or two bigger; i toggle between the fill states to indicate toggled state on a screen and the button size changes ever so slightly and it just doesn’t make sense why that would be something explicitly decided upon

jphambleton [1:20 PM] May be inherited from another element. Might just want to affect the global sheets for that state specifically.

mdlallemont [1:45 PM] @jtth I’m running into the same issue. It would be great if they were consistent or at least give us a good reference doc for how to override the styles for that.

chrisgriffith [2:13 PM] @jtth @mdlallemont It is the border-width value that is different between the two styles. I have opened an issue on it.

0reactions
ionitron-bot[bot]commented, Jun 2, 2021

Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Thank you for using Ionic!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button border-width sizing not matching · Issue #18192 - GitHub
Expected behavior: The border-width's should match. Steps to reproduce: Create two buttons, one set to outline and one set to fill. Have the ......
Read more >
Why does a button element's height not match that of a sibling ...
I have the following: <div style="border:solid 1px ...
Read more >
border-width - CSS: Cascading Style Sheets - MDN Web Docs
The border-width shorthand CSS property sets the width of an element's border. ... It also applies to ::first-letter . Inherited, no.
Read more >
Page borders may be displayed or printed incorrectly in Word ...
Describes how to work around a problem where borders in a Word document may not print or be displayed as expected. This problem...
Read more >
Overriding Default Button Styles | CSS-Tricks
There are a variety of "buttons" in HTML. ... default look, one with a border and square corners, a gradient background, and no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found