Add Additional Text Color Configuration Options #15150
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch (orv[X]
branch)fix: #xxx[,#xxx]
, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
While implementing a dark mode theme I ran across an issue where the light mode
secondary
color we selected looked good on aq-btn
with the default white text, but the dark modesecondary
color isn't readable with white text. The issue can obviously be solved by providing atext-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 acolor
andtext-color
prop will default the text class totext-on-[color]
if acolor
is provided but notext-color
. Anytime atext-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.