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

Add Additional Text Color Configuration Options #15150

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

PrinceManfred
Copy link

@PrinceManfred PrinceManfred commented Dec 20, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Documentation
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes
  • No

The PR fulfills these requirements:

  • It's submitted to the dev branch (or v[X] branch)
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • It's been tested on a Cordova (iOS, Android) app
  • It's been tested on an Electron app
  • Any necessary documentation has been added or updated in the docs or explained in the PR's description.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to start a new feature discussion first and wait for approval before working on it)

Other information:
While implementing a dark mode theme I ran across an issue where the light mode secondary color we selected looked good on a q-btn with the default white text, but the dark mode secondary color isn't readable with white text. The issue can obviously be solved by providing a text-color value, but it's easier to ensure that my team is consitent with styles if the text color selection follows from the background color selection.

This pull request adds the following SASS variables: $on-default, $on-primary, $on-secondary, $on-accent, $on-positive, $on-negative, $on-info, and $on-warning, plus $on-[all color variants]. These new variables represent the preferred text color for text appearing on backgrounds colored with their existing color counterparts. By default they are set to $on-default which has a value on '#FFF`.

It also adds --q-on-primary, --q-on-secondary, --q-on-accent, --q-on-positive, --q-on-negative, --q-on-info, and --q-on-warning as css properties on the root element to expose these values and allow for changes at runtime.

Finally, it adds text-on-[color] classes for all defined colors. All components that accept a color and text-color prop will default the text class to text-on-[color] if a color is provided but no text-color. Anytime a text-color is supplied it is used instead.

My only uncertainty is how to update the brand configuration in quasar.config.js to optionally accept the new color options.
Default values shouldn't cause any visual difference in the vast majority of existing sites. The biggest possible break would be name collisions if users are using any of the new variable, property, or class names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant