Skip to content

feat(button): add ionic theme implementation - #29187

Merged
sean-perkins merged 36 commits into
nextfrom
ROU-4815
Mar 26, 2024
Merged

feat(button): add ionic theme implementation#29187
sean-perkins merged 36 commits into
nextfrom
ROU-4815

Conversation

@joselrio

@joselriojoselrio commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

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 a team and brandyscarney as code ownersMarch 20, 2024 10:22
@github-actionsgithub-actionsBot added the package: core @ionic/core package label Mar 20, 2024
Comment threadcore/src/components/button/button.tsx Outdated
Comment threadcore/src/components/button/button.tsx Outdated

@OS-giulianasilvaOS-giulianasilva left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadcore/src/themes/ionic.functions.sizes.scss Outdated

@sean-perkinssean-perkins left a comment

Copy link
Copy Markdown
Contributor

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.

Comment threadcore/src/components/button/button.ionic.scss
Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.tsx Outdated
Comment threadcore/src/components/button/button.tsx Outdated
Comment threadcore/src/components/button/test/theme-ionic/index.html
Comment threadcore/src/themes/ionic.functions.sizes.scss Outdated
Comment threadcore/src/components/button/test/theme-ionic/button.e2e.ts Outdated
Comment threadcore/src/components/button/test/theme-ionic/button.e2e.ts Outdated
Comment threadcore/src/components/button/test/theme-ionic/button.e2e.ts Outdated
Comment threadcore/src/components/button/button.tsx
joselrioand others added 2 commits March 21, 2024 14:11
Co-authored-by: Sean Perkins <13732623+sean-perkins@users.noreply.github.com>
@joselrio

Copy link
Copy Markdown
ContributorAuthor

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

Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.tsx Outdated
Comment threadcore/src/components/button/button.ionic.vars.scss Outdated
Comment threadcore/src/themes/ionic.functions.sizes.scss Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Comment threadcore/src/components/button/button.ionic.scss Outdated
Co-authored-by: Brandy Carney <brandyscarney@users.noreply.github.com>
Comment threadcore/src/components/button/button.ionic.scss Outdated
joselrioand 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>
Comment threadcore/src/components/button/button.tsx Outdated
Comment threadcore/src/components/button/button.tsx
Comment threadcore/src/components/button/button.tsx
Comment threadcore/src/components/button/test/theme-ionic/index.html
Comment threadcore/src/components/button/test/theme-ionic/button.e2e.ts Outdated
Comment threadcore/src/components/button/button.ionic.scss Outdated
sean-perkinsand others added 4 commits March 21, 2024 16:49
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>
Co-authored-by: Maria Hutt <thetaPC@users.noreply.github.com>

@thetaPCthetaPC left a comment

Copy link
Copy Markdown
Contributor

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.

joselrioand 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.
@sean-perkinssean-perkins changed the title [feat](button): Add new button features under the scope for the new ionic theme.feat(button): add ionic theme implementationMar 25, 2024
@joselrio
joselrio requested a review from thetaPCMarch 25, 2024 18:52
@joselrio

Copy link
Copy Markdown
ContributorAuthor

@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.

@sean-perkinssean-perkins left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@sean-perkins

Copy link
Copy Markdown
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.

@thetaPCthetaPC left a comment

Copy link
Copy Markdown
Contributor

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 reviewMarch 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 nextMar 26, 2024
@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 freeto 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

@joselrio@thetaPC@sean-perkins@brandyscarney@bmarcelino-fe@OS-giulianasilva@JoaoFerreira-FrontEnd