Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Remove deprecated color variables with P2.0 update #123

@samthecodingman

Description

@samthecodingman

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-color variables
  • 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-color in paper-fab.html.
  • Non-functional change: Substitute --default-primary-color with --primary-color in paper-dialog-shared-styles.html
  • CRITICAL: Update mentions of --text-primary-color and --default-primary-color in paper-styles/demo/index.html
  • Appropriately substitute --dark-theme-text-color throughout the PolymerElements catalog with --primary-contrast-color or --accent-contrast-color as 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-color in most use cases and --accent-contrast-color in a select few (such as paper-fab).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions