-
Notifications
You must be signed in to change notification settings - Fork 93
Remove deprecated color variables with P2.0 update #123
Description
Description
With the Polymer 2.0 update inbound and breaking changes expected, it might be time to clear out the deprecated --text-primary-color and --default-primary-color values from default-theme.html.
The substitution of --default-primary-color to --primary-color is self-explanatory.
However, --text-primary-color is not so simple. From what I've read it had the meaning "text color over primary colored backgrounds". After it's deprecation, this appears to have been patched in many places as --dark-theme-text-color (defaults to #FFFFFF). However usage like this is confusing as well as demonstrated by #110.
I propose renaming --text-primary-color to --primary-contrast-color and --accent-contrast-color, which would be the foreground color on the primary and accent background colors respectively.
The definition of contrast used here being "strikingly different from something else". I believe this to be clear enough to replace the existing --text-primary-color. For a single alternative name, you could use --contrast-color or --contrast-text-color which would default to --dark-theme-text-color.
The word 'contrast' may not be the ideal fit, but IMO it's meaning is concise enough for widespread use.
Reasoning
- These variables have been deprecated since at least Dec 2015.
- Switching to the dark theme would be less troublesome with the core elements.
- Clarity of meaning regarding 'random' use of
--dark-theme-text-colorvariables - Ease of changing foreground color of
paper-fab-like accent elements (e.g. dark grey foreground)
Conflicts
These are the changes required to roll out this update. "Critical" changes are breaking changes.
- CRITICAL: Substitute
--text-primary-colorin paper-fab.html. - Non-functional change: Substitute
--default-primary-colorwith--primary-colorin paper-dialog-shared-styles.html - CRITICAL: Update mentions of
--text-primary-colorand--default-primary-colorin paper-styles/demo/index.html - Appropriately substitute
--dark-theme-text-colorthroughout thePolymerElementscatalog with--primary-contrast-coloror--accent-contrast-coloras required.
Requirements for a P2.0 Migration Tool
As part of any Polymer 2.0 Migration Tool, the following substitutions would be performed if this change is implemented.
--default-primary-color-->--primary-color--text-primary-color-->--primary-contrast-colorin most use cases and--accent-contrast-colorin a select few (such aspaper-fab).