Skip to content

Conversation

@ycintre
Copy link
Contributor

@ycintre ycintre commented Dec 8, 2020

closes #22637

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

ion-refresh for material design does not have a dark mode

image

Issue Number: #22637

What is the new behavior?

ion-refresher for material design displays nicely on dark mode

image

The refresher color was hardcoded as white for the background and #ececec for the border.
This change introduce a 3 steps fallback:

  • for the background: --ion-refresher-background (this is a new variable), of fallback to --ion-color-step-250, or fallback to #ffffff (original color)
  • for the border color: --ion-refresher-border-color (this is a new variable), of fallback to --ion-color-step-200, or fallback to #ececec (original color)

Does this introduce a breaking change?

  • Yes
  • No

Other information

I didn't find an easy way to run the stencil tests with dark mode so I just quickly added the dark mode config from the doc in core/scripts/testing/styles.css (didn't commit this obviously :D )
What's the proper way run the tests in dark mode?

Also should the 2 new variables --ion-refresher-background & --ion-refresher-border-color be documented somewhere? In the component page? In the dark mode page?

@github-actions github-actions bot added the package: core @ionic/core package label Dec 8, 2020
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

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

This looks great, thank you! When comparing to the refresher built in to Android, the arrow seems a bit lighter on dark mode, but I don't think that's a huge deal. cc @brandyscarney Thoughts?

@liamdebeasi liamdebeasi changed the title fix(refresher): support dark mode on material design fix(refresher): refresher now correctly styled in dark mode Dec 10, 2020
@liamdebeasi
Copy link
Contributor

Brandy pointed out that this adds 2 new CSS variables, --ion-refresher-background and --ion-refresher-border-color which would make this a feature not a fix. I will update the PR title and move this to the appropriate milestone.

@liamdebeasi liamdebeasi changed the title fix(refresher): refresher now correctly styled in dark mode feat(refresher): refresher now correctly styled in dark mode Jan 13, 2021
@liamdebeasi
Copy link
Contributor

Hey there, I made a few changes to your PR. After discussing with the team, we removed the --ion-refresher-background and --ion-refresher-border-color CSS Variables. These variables are intended to be usable across iOS and MD modes, but the refresher in iOS mode does not have a background or border.

Your PR is good to go, so I will be merging one the build passes. Thanks!

@liamdebeasi liamdebeasi merged commit c05476b into ionic-team:master Feb 11, 2021
@liamdebeasi
Copy link
Contributor

Merged. Thank you!

cerkiner added a commit to cerkiner/ionic that referenced this pull request Mar 2, 2021
* master: (284 commits)
  fix(label): only show placeholder with floating label when focused (ionic-team#22958)
  feat(react): add react hooks to control overlay components (ionic-team#22484)
  feat(vue): add composition API ionic lifecycle hooks (ionic-team#22970)
  chore(): run build
  5.5.5
  fix(vue): account for event name changes in vue 3.0.6+
  fix(react, vue): navigating using ion-back-button now selects correct page (ionic-team#22974)
  fix(progress-bar): use correct theme colors in dark mode (ionic-team#22965)
  fix(progress-bar): add width transition (ionic-team#22964)
  fix(vue): prevent race conditions when opening overlays (ionic-team#22883)
  fix(progress-bar): use correct theme colors in dark mode (ionic-team#22957)
  feat(searchbar): add showClearIcon property (ionic-team#22759)
  test(): update theming test with latest dark mode values (ionic-team#22956)
  chore(): update package-lock to account for npm 7.5.3 bug fix (ionic-team#22963)
  fix(header): collapsed toolbar is no longer incorrectly shown when using ion-refresher (ionic-team#22937)
  fix(react): onIonTabsWillChange and onIonTabsDidChange event handlers are now properly bound to IonTabs (ionic-team#22233)
  fix(refresher): add correct dark mode styles (ionic-team#22639)
  feat(custom-elements): add experimental custom elements build  (ionic-team#22863)
  fix(a11y): improve support for ids with special characters when getting label element (ionic-team#22680)
  chore(): update code of conduct (ionic-team#22619)
  ...
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.

bug: material ion-refresher does not have a dark mode

2 participants