-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
fix(button): size and strong are respected in ion-buttons #26726
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run & review this pull request in StackBlitz Codeflow. |
liamdebeasi
changed the title
fix(button): size is respected in ion-buttons
fix(button): size and strong are respected in ion-buttons
Feb 3, 2023
averyjohnston
approved these changes
Feb 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from a few typos.
Co-authored-by: Amanda Johnston <[email protected]>
Co-authored-by: Amanda Johnston <[email protected]>
Co-authored-by: Amanda Johnston <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request checklist
Please check if your PR fulfills the following requirements:
ionic-docs
repo, in a separate PR. See the contributing guide for details.npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue URL: resolves #16289
The
size
andstrong
properties onion-button
are not respected when placed insideion-buttons
. This is because Ionic manually sets the font-size/font-weight on all slotted buttons:ionic-framework/core/src/components/buttons/buttons.ios.scss
Lines 16 to 17 in 9d6ec29
ionic-framework/core/src/components/buttons/buttons.md.scss
Lines 18 to 19 in 9d6ec29
This was likely done to ensure buttons in a toolbar have consistent container sizes (since we manually set the height as well). However, this breaks the
size
/strong
functionality onion-button
.However, default size iOS buttons have a slightly increased font size when used in a toolbar. This difference needs to be preserved while allowing for
size
functionality:What is the new behavior?
font-size
andfont-weight
declarations inion-buttons
in MD mode. These values are used inside theion-button
stylesheets, so this change should not impact buttons that do not make use ofsize
/strong
. Default size /weight MD buttons have the same font size and weight regardless of usage.font-size
andfont-weight
declaration inion-buttons
in iOS mode. Instead, I added a.in-buttons
selector to the iOS button stylesheet that applies the increased font size/weight. This approach allows thesize
andstrong
properties to override the default font size and font weight, respectively. The alternative was to use:not
to create a specific selector that excluded larger/smallersize
values, but I felt that would make customizing the button hard.size
andstrong
tests while I was in this code. These screenshots had quite a bit of whitespace and tested configurations that did not test the actual functionality.I opted to keep the
height
property here because this allows the font sizes to increase while keeping the container sizes consistent. If we removed theheight
, then the container sizes would be different which I think is incorrect:Does this introduce a breaking change?
Other information