-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(button): add ionic theme implementation #29187
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
1f3e134
[feat](button): Added new ionic theme and sizes.
joselrio e8dcab3
[feat](button): lint.sass.fix
joselrio 025da98
[tests](button): Added new ionic theme tests.
joselrio 11e87a1
[feat](button): Updated comment.
joselrio e41a2c6
[feat](button): Update api.txt
joselrio ebfa926
[feat](button): lint
joselrio ac591f1
[feat](button): typo
joselrio 4cc1a04
[feat](button): fixed units.
joselrio 5b5851c
Update core/src/components/button/button.tsx
joselrio 8a75ecf
[feat](button): Feedback improvements.
joselrio 5f89bf2
style(button): align Sass comments with md and ios vars
brandyscarney d6f05f6
Update core/src/components/button/button.ionic.scss
joselrio 6a0fb94
Update core/src/components/button/button.tsx
joselrio 98629a5
Update core/src/components/button/button.ionic.scss
joselrio 8d16fd5
Update core/src/components/button/button.ionic.scss
joselrio af32d25
Update core/src/components/button/button.ionic.scss
joselrio f3ecd62
Update core/src/components/button/button.ionic.scss
joselrio fd3cf71
[style](button): removed default word.
joselrio 21851bf
[style](button): feedback improvements
joselrio b38abf7
Update core/src/components/button/button.ionic.scss
joselrio 77ee2c1
Update core/src/components/button/button.ionic.scss
joselrio 7f35ac9
Update core/src/components/button/button.ionic.scss
joselrio d69eb3f
Merge remote-tracking branch 'origin/next' into ROU-4815
joselrio c1c0e76
[style](button): Changed the way border is hide to avoid flickering.
joselrio 2436860
Merge remote-tracking branch 'origin/next' into ROU-4815
sean-perkins 6753ba7
Update core/src/components/button/button.ionic.scss
joselrio 2e872b2
Update core/src/components/button/button.tsx
joselrio bedc6e9
[fix](button): typo
joselrio ac4d8ec
[fix](button): lint
joselrio 6fae295
Update checkbox.ios.scss
JoaoFerreira-FrontEnd 94f6303
[fix](button): Removed unneeded tests.
joselrio 961ef7e
test(button): ionic theme tests (#29201)
sean-perkins 7bfb483
Merge branch 'ROU-4815' of https://github.com/ionic-team/ionic-framew…
JoaoFerreira-FrontEnd 1a9e85a
chore: link tech-debt task
sean-perkins 0e4fb4d
fix: use border-radius mixin, update comment blocks
sean-perkins 76903b0
chore: remove diff
sean-perkins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,237 @@ | ||
| @import "./button"; | ||
| @import "./button.ionic.vars"; | ||
|
|
||
| // Ionic Button | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| :host { | ||
| --border-radius: #{$button-ionic-border-radius}; | ||
| --padding-bottom: var(--padding-top); | ||
| --padding-end: #{$button-ionic-padding-end}; | ||
| --padding-start: var(--padding-end); | ||
| --padding-top: #{$button-ionic-padding-top}; | ||
| --focus-ring-color: #9ec4fd; | ||
| --focus-ring-width: 2px; | ||
|
|
||
| position: relative; | ||
|
|
||
| min-height: #{$button-ionic-min-height}; | ||
|
|
||
| font-size: #{$button-ionic-font-size}; | ||
|
|
||
| // Target area | ||
| &::after { | ||
| @include position(50%, 0, null, 0); | ||
| position: absolute; | ||
|
|
||
| height: 100%; | ||
| min-height: px-to-rem(48); | ||
|
|
||
| transform: translateY(-50%); | ||
|
|
||
| content: ""; | ||
|
|
||
| cursor: pointer; | ||
|
|
||
| z-index: 1; | ||
| } | ||
|
|
||
| ::slotted(ion-icon[slot="start"]) { | ||
| @include margin-horizontal(null, px-to-rem(8)); | ||
| } | ||
|
|
||
| ::slotted(ion-icon[slot="end"]) { | ||
| @include margin-horizontal(px-to-rem(8), null); | ||
| } | ||
| } | ||
|
|
||
| // Button Sizes | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| /* Extra Small and Small Button */ | ||
| :host(.button-xsmall), | ||
| :host(.button-small) { | ||
| ::slotted(ion-icon[slot="start"]) { | ||
| @include margin-horizontal(null, px-to-rem(4)); | ||
| } | ||
|
|
||
| ::slotted(ion-icon[slot="end"]) { | ||
| @include margin-horizontal(px-to-rem(4), null); | ||
| } | ||
| } | ||
|
|
||
| /* Extra Small Button */ | ||
| :host(.button-xsmall) { | ||
| --border-radius: #{$button-ionic-xsmall-border-radius}; | ||
| --padding-top: #{$button-ionic-xsmall-padding-top}; | ||
| --padding-end: #{$button-ionic-xsmall-padding-end}; | ||
|
|
||
| min-height: #{$button-ionic-xsmall-min-height}; | ||
|
|
||
| font-size: #{$button-ionic-xsmall-font-size}; | ||
| } | ||
|
|
||
| /* Small Button */ | ||
| :host(.button-small) { | ||
| --border-radius: #{$button-ionic-small-border-radius}; | ||
| --padding-top: #{$button-ionic-small-padding-top}; | ||
| --padding-end: #{$button-ionic-small-padding-end}; | ||
|
|
||
| min-height: #{$button-ionic-small-min-height}; | ||
|
|
||
| font-size: #{$button-ionic-small-font-size}; | ||
| } | ||
|
|
||
| /* Large Button */ | ||
| :host(.button-large) { | ||
| --padding-top: #{$button-ionic-large-padding-top}; | ||
| --padding-end: #{$button-ionic-large-padding-end}; | ||
|
|
||
| min-height: #{$button-ionic-large-min-height}; | ||
|
|
||
| font-size: #{$button-ionic-large-font-size}; | ||
| } | ||
|
|
||
| /* Extra Large Button */ | ||
| :host(.button-xlarge) { | ||
| --padding-top: #{$button-ionic-xlarge-padding-top}; | ||
| --padding-end: #{$button-ionic-xlarge-padding-end}; | ||
|
|
||
| min-height: #{$button-ionic-xlarge-min-height}; | ||
|
|
||
| font-size: #{$button-ionic-xlarge-font-size}; | ||
| } | ||
|
|
||
| // Button with Icons | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| /* Button containing only an icon */ | ||
| ::slotted(ion-icon[slot="start"]), | ||
| ::slotted(ion-icon[slot="end"]), | ||
| ::slotted(ion-icon[slot="icon-only"]) { | ||
| font-size: 1em; | ||
| } | ||
|
|
||
| /* Button extra small */ | ||
| :host(.button-has-icon-only.button-xsmall) { | ||
| --padding-end: #{$button-has-icon-only-padding-end-xsmall}; | ||
| } | ||
|
|
||
| /* Button small */ | ||
| :host(.button-has-icon-only.button-small) { | ||
| --padding-end: #{$button-has-icon-only-padding-end-small}; | ||
| } | ||
|
|
||
| /* Default */ | ||
| :host(.button-has-icon-only) { | ||
| --padding-end: #{$button-has-icon-only-padding-end}; | ||
| } | ||
|
|
||
| /* Button large */ | ||
| :host(.button-has-icon-only.button-large) { | ||
| --padding-end: #{$button-has-icon-only-padding-end-large}; | ||
| } | ||
|
|
||
| /* Button extra large */ | ||
| :host(.button-has-icon-only.button-xlarge) { | ||
| --padding-end: #{$button-has-icon-only-padding-end-xlarge}; | ||
| } | ||
|
|
||
| // Button Shapes | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| // Button Shape Rectangular | ||
| // ------------------------------------------------------------------------------- | ||
| :host(.button-rectangular) { | ||
| --border-radius: #{$button-ionic-rectangular-border}; | ||
| } | ||
|
|
||
| // Button Shape Round | ||
| // ------------------------------------------------------------------------------- | ||
| :host(.button-round) { | ||
| --border-radius: #{$button-ionic-round-border}; | ||
| } | ||
|
|
||
| // Button Focused | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| // Only show the focus ring when the button is focused | ||
| :host(.ion-focused) { | ||
| --overflow: visible; | ||
|
|
||
| .button-native::after { | ||
| @include border-radius(inherit); | ||
| } | ||
| } | ||
|
|
||
| .button-focus-ring { | ||
| @include position(-4px, -4px, -4px, -4px); | ||
| @include border-radius(inherit); | ||
|
|
||
| position: absolute; | ||
|
|
||
| transition: border-color 0.3s; | ||
|
|
||
| border: var(--focus-ring-width) solid var(--focus-ring-color); | ||
|
|
||
| content: ""; | ||
| box-sizing: border-box; | ||
| } | ||
|
|
||
| // Fill Solid Button | ||
| // ------------------------------------------------------------------------------- | ||
|
|
||
| :host(.button-solid) { | ||
| --background-activated: #{ion-color(primary, shade)}; | ||
| } | ||
|
|
||
| // Fill Outline Button | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.button-outline) { | ||
| --border-width: #{$button-ionic-outline-border-width}; | ||
| --border-style: #{$button-ionic-outline-border-style}; | ||
| --background-activated: #e3e3e3; | ||
| --background-activated-opacity: 1; | ||
| --background-focused: transparent; | ||
| --background-hover: transparent; | ||
| --background-focused-opacity: 0.1; | ||
| --color-activated: #{ion-color(primary, base)}; | ||
| } | ||
|
|
||
| :host(.button-outline.ion-focused) { | ||
| --border-color: transparent; | ||
| } | ||
|
|
||
| // Fill Clear Button | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.button-clear) { | ||
| --background-activated: #e3e3e3; | ||
| --background-activated-opacity: 1; | ||
| --background-focused: transparent; | ||
| --background-hover: transparent; | ||
| } | ||
|
|
||
| // Button Hover | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.button-outline), | ||
| :host(.button-clear) { | ||
| --background-hover: #121212; | ||
| --background-hover-opacity: 0.04; | ||
| } | ||
|
|
||
| // Button: Disabled | ||
| // -------------------------------------------------- | ||
|
|
||
| :host(.button-disabled) { | ||
| --color: #c9c9c9; | ||
| --border-color: var(--color); | ||
|
|
||
| opacity: 1; | ||
| } | ||
|
|
||
| :host(.button-solid.button-disabled) { | ||
| --background: #f5f5f5; | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.