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

feat(button): add ionic theme implementation #29187

Merged
merged 36 commits into from
Mar 26, 2024
Merged

feat(button): add ionic theme implementation #29187

merged 36 commits into from
Mar 26, 2024

Conversation

joselrio
Copy link

@joselrio joselrio commented Mar 20, 2024

Issue number: ROU-4815


What is the new behavior?

  • Adds an ionic theme style implementation for ion-button.
    • Adds a new rectangular shape to the button.
    • Adds two new button sizes: xsmall and xlarge.
    • Adds a new focus-ring CSS shadow part for the ionic theme.

Does this introduce a breaking change?

  • Yes
  • No

Preview

Screen-Recording-2024-03-20-at-1

@joselrio joselrio requested review from brandyscarney and a team as code owners March 20, 2024 10:22
@github-actions github-actions bot added the package: core @ionic/core package label Mar 20, 2024
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@OS-giulianasilva OS-giulianasilva left a comment

Choose a reason for hiding this comment

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

The button sizes seem to not be exactly what is designed, for example, the Extra large button height is 70px instead of 56px.

core/src/themes/ionic.functions.sizes.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

Tested locally, really great work here!

I've commented on some code style and testing best practices.

When making changes to some of the code documentation, you will need to run npm run build locally to regenerate certain files.

I need to run, but I can provide information on generating screenshot in a follow-up comment later.

core/src/components/button/button.ionic.scss Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/themes/ionic.functions.sizes.scss Outdated Show resolved Hide resolved
core/src/components/button/test/theme-ionic/button.e2e.ts Outdated Show resolved Hide resolved
core/src/components/button/test/theme-ionic/button.e2e.ts Outdated Show resolved Hide resolved
core/src/components/button/test/theme-ionic/button.e2e.ts Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
joselrio and others added 2 commits March 21, 2024 14:11
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
@joselrio
Copy link
Author

@sean-perkins amazing feedback! Super useful to get deeper context...
Thank you! :)

core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.vars.scss Outdated Show resolved Hide resolved
core/src/themes/ionic.functions.sizes.scss Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
joselrio and others added 4 commits March 21, 2024 16:10
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/button.tsx Outdated Show resolved Hide resolved
core/src/components/button/test/theme-ionic/button.e2e.ts Outdated Show resolved Hide resolved
core/src/components/button/button.ionic.scss Outdated Show resolved Hide resolved
sean-perkins and others added 4 commits March 21, 2024 16:49
Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

Request me once Sean's PR has been merged into this branch.

joselrio and others added 3 commits March 25, 2024 09:53
Issue number: N/A

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

Adding new e2e tests into Ionic Framework can be difficult for new
contributors when it comes to knowing where existing test cases exist
and how to additionally add a new theme or option to the test.

To avoid a lot of back and forth feedback in Github comments, I split up
the test on the original PR to help demonstrate how to match existing
test structures.

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Removes the proposed test specific to the Ionic theme.
- Migrates the tests into the existing e2e files for button, adding
specific test cases that only apply to the ionic theme.
- Added screenshot references

In this work, I tried to correct some legacy folder naming:
- `button/test/round` → `button/test/shape`
- For `fill="clear"` I updated the screenshot names, but left the folder
structure. There is more work here to organize `fill="outline"` and it
is not required at this time.


## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

I left the HTML template for the ionic theme test alone. I figure this
is helpful to the developer, until the primary PR is approved. Then it
could be removed if it is no longer useful.
@joselrio joselrio requested a review from averyjohnston as a code owner March 25, 2024 12:23
@sean-perkins sean-perkins changed the title [feat](button): Add new button features under the scope for the new ionic theme. feat(button): add ionic theme implementation Mar 25, 2024
@joselrio joselrio requested a review from thetaPC March 25, 2024 18:52
@joselrio
Copy link
Author

@thetaPC missing tests will be done under another task that will be created. This PR should not be blocked for now due to those missing tests. Thank you :)

This whitespace change should not exist.
Copy link
Contributor

@sean-perkins sean-perkins left a comment

Choose a reason for hiding this comment

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

Great work on this 👏

I've updated the use of the border-radius property for our @include border-radius mixin. I've also updated a few comment blocks in the Sass stylesheet, but we can continue to update that as additional features are added.

I believe this PR is ready for merge. I've linked technical debt tasks after another PR for test infrastructure is merged. When that happens, a test template will be removed and new screenshots for test cases will be added.

We should provide the Design team with a build of these changes, so they can validate the accuracy of the implementation as well, unless they have already looked and approved the implementation separately.

@thetaPC
Copy link
Contributor

thetaPC commented Mar 25, 2024

@joselrio I noticed that Sean's PR was merged into this one. But I'm not seeing his changes here.

@sean-perkins
Copy link
Contributor

@thetaPC the changes were added as part of this commit: 7bfb483. I generated the screenshots and added a few test cases that are not blocked by #29206.

I created FW-6077 to track adding the remaining tests. I added // TODO statements in the code where those apply.

Copy link
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM

@sean-perkins sean-perkins dismissed brandyscarney’s stale review March 26, 2024 02:16

Spoke with Brandy internally and we split up some current priorities. I grabbed the review so she can tackle another priority.

@sean-perkins sean-perkins merged commit 4cf1b97 into next Mar 26, 2024
42 checks passed
@sean-perkins sean-perkins deleted the ROU-4815 branch March 26, 2024 02:17
joselrio added a commit that referenced this pull request Apr 10, 2024
Issue number: ROU-4815

---------
## What is the current behavior?
- Ionic theme, Icon size was 14px to the default button size;

## What is the new behavior?
- Ionic theme, Icon size has now 16px to the default button size;

## NOTE:
- Tests related... this a fix on top of [PR of ROU-4815
branch](#29187) and as
was mentioned there, tests will be implemented under a task that will be
then created specifically for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants