Implement $darken1, $darken2, and $darken3 utilities #726
Labels
category: library
Shared code library
DEV: frontend
good first issue
Self-contained, straightforward, low-complexity
help wanted
Open source contributors welcome
P2 - normal
Priority: Nice to have
Milestone
🌱 Are you new to the codebase? Welcome! Please see the contributing guidelines.
Blocks
Summary
$darken1
,$darken2
, and$darken3
will be new utilities that will allow us to darken palette colors to achieve new colors that are still derived from a palette, but without the need to add them to the palette.When Kolibri Design System is initialized in a consumer via
Vue.use(KThemePlugin)
, these three$darken_
helpers should be installed to all Vue instances, similarly how it’s currently done for$themeTokens
,$themePalette
, and other helpers.Then, every Vue component can use them without the need to import. Examples:
As for the actual color darkness shifts, we will use the following guidance from designers as a starting point. Note that (1) the algorithm used for
$darken_
helpers should always be the same (no need to distinguish on which color it is being applied), (2) the expected hex values below are just estimates. So, the resulting hex values don't need to be exactly the same, but rather be as close as possible.$darken1($themePalette.red.v_1100)
to produce#A81700
$darken2($themePalette.red.v_1100)
to produce#7E1200
$darken3($themePalette.red.v_1100)
to produce#540C00
$darken1($themePalette.lightblue.v_1100)
to produce#00619B
$darken2($themePalette.lightblue.v_1100)
to produce#004974
$darken3($themePalette.lightblue.v_1100)
to produce#00304E
References
Slack thread
Guidance
color.darken()
)$themeTokens
or$themePalette
in KThemePlugin.js to understand how to define new helpers in a similar mannerThe Value Add
Background
Motivated by a Kolibri’s red button that needs to use
palette.red.v_1100
as its background color. This is our darkest red and for the button’s hover state, we needed even darker color that is currently hardcoded here Additionally, designers had some work in progress figuring out adding more flexibility to our palette that is aligned with this approach.Acceptance Criteria
red.v_1100
The text was updated successfully, but these errors were encountered: