fix(button): size and strong are respected in ion-buttons - #26726
Merged
Conversation
|
|
liamdebeasi
marked this pull request as ready for review
February 3, 2023 17:18
averyrousseau
approved these changes
Feb 6, 2023
averyrousseau
left a comment
Contributor
There was a problem hiding this comment.
LGTM aside from a few typos.
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
Co-authored-by: Amanda Johnston <90629384+amandaejohnston@users.noreply.github.com>
This file contains hidden or 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
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-docsrepo, 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
sizeandstrongproperties onion-buttonare 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/strongfunctionality 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
sizefunctionality:What is the new behavior?
font-sizeandfont-weightdeclarations inion-buttonsin MD mode. These values are used inside theion-buttonstylesheets, 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-sizeandfont-weightdeclaration inion-buttonsin iOS mode. Instead, I added a.in-buttonsselector to the iOS button stylesheet that applies the increased font size/weight. This approach allows thesizeandstrongproperties to override the default font size and font weight, respectively. The alternative was to use:notto create a specific selector that excluded larger/smallersizevalues, but I felt that would make customizing the button hard.sizeandstrongtests 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
heightproperty 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