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

enhancement: stop overriding ion-color variables #14808

Closed
brandyscarney opened this issue Jul 19, 2018 · 5 comments
Closed

enhancement: stop overriding ion-color variables #14808

brandyscarney opened this issue Jul 19, 2018 · 5 comments
Assignees
Labels
package: core @ionic/core package

Comments

@brandyscarney
Copy link
Member

brandyscarney commented Jul 19, 2018

We should stop overriding the ion-color-* variables in our components such as:

--ion-color-base
--ion-color-contrast
--ion-color-*

This caused conflicts with tabs and probably others. We should instead have some consistent naming that makes it easy for users to know what the property is affecting such as:

--background: #{ion-color(primary, base)};
--color: #{ion-color(primary, contrast)};

Up for discussion but we should get this done sooner rather than later to avoid another API change. cc @manucorporat @camwiegert

@brandyscarney brandyscarney added css package: core @ionic/core package labels Jul 19, 2018
@manucorporat
Copy link
Contributor

So, you meant we should start using:

:host(.ion-color) {
  --background: #{ion-color(primary, base)};
}

Note, most of the time we don't need CSS vars for text, we can just inherit these from light dom, we can just use color.

@camwiegert
Copy link
Contributor

Agreed that --ion-color-* vars should be read-only. Seems like a simple convention is best for var names? (e.g. --component-property => --button-background-color)

@manucorporat
Copy link
Contributor

i think scoping CSS vars with the component name is a different topic thought, what's the problem with the current CSS var naming?

@brandyscarney brandyscarney self-assigned this Jul 20, 2018
@brandyscarney brandyscarney added package: core @ionic/core package and removed package: core @ionic/core package labels Jul 20, 2018
camwiegert added a commit that referenced this issue Aug 8, 2018
@camwiegert camwiegert self-assigned this Aug 13, 2018
brandyscarney added a commit that referenced this issue Aug 14, 2018
brandyscarney added a commit that referenced this issue Aug 14, 2018
brandyscarney added a commit that referenced this issue Aug 14, 2018
brandyscarney added a commit that referenced this issue Aug 14, 2018
brandyscarney added a commit that referenced this issue Aug 16, 2018
brandyscarney added a commit that referenced this issue Aug 16, 2018
camwiegert added a commit that referenced this issue Aug 17, 2018
camwiegert added a commit that referenced this issue Aug 30, 2018
brandyscarney added a commit that referenced this issue Sep 4, 2018
brandyscarney added a commit that referenced this issue Sep 5, 2018
…15463)

- adds custom properties 
- removes the overrides of `--ion-color-*` variables
- documents the properties

references #14808 references #14853 references #14850
@brandyscarney
Copy link
Member Author

brandyscarney commented Sep 5, 2018

Remaining components with these overrides:

  • back-button
  • fab-button
  • item-divider
  • item-option
  • item
  • label
  • list-header

camwiegert added a commit that referenced this issue Sep 7, 2018
camwiegert added a commit that referenced this issue Sep 20, 2018
camwiegert added a commit that referenced this issue Sep 20, 2018
camwiegert added a commit that referenced this issue Sep 20, 2018
camwiegert added a commit that referenced this issue Sep 24, 2018
pull bot pushed a commit to peterennis/ionic that referenced this issue Sep 24, 2018
removes use of `--ion-color-*` variables references ionic-team#14808
documents custom properties references ionic-team#14850
uses `—background` vars to prevent overriding the color css references
ionic-team#14853
@ionitron-bot
Copy link

ionitron-bot bot commented Nov 10, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package
Projects
None yet
Development

No branches or pull requests

3 participants