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

[DOCS] Update daff-illuminate function documentation #1412

Open
Tracked by #2767
xelaint opened this issue Apr 6, 2021 · 1 comment
Open
Tracked by #2767

[DOCS] Update daff-illuminate function documentation #1412

xelaint opened this issue Apr 6, 2021 · 1 comment
Assignees
Labels
docs This issue is related to documentation p2 medium priority
Milestone

Comments

@xelaint
Copy link
Member

xelaint commented Apr 6, 2021

📄 Documentation Request

What were you doing?

I don't understand how daff-illuminate works.

Expected behavior

I want to know what daff-illuminate does with usage examples and detailed documentation.

Existing Documentation

https://github.com/graycoreio/daffodil/tree/develop/libs/design/src/scss/theming/illuminate

Environment


Daffodil version: X.Y.Z
Angular version: X.Y.Z 

 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

@xelaint xelaint added the docs This issue is related to documentation label Apr 6, 2021
@xelaint xelaint added this to the v0.4.0 - The Big Docs update milestone Apr 6, 2021
@xelaint xelaint self-assigned this Apr 6, 2021
@xelaint xelaint pinned this issue Apr 6, 2021
@xelaint xelaint unpinned this issue Aug 18, 2021
@AnnieMi888 AnnieMi888 added the p2 medium priority label Dec 15, 2023
@xelaint xelaint self-assigned this Jul 1, 2024
@xelaint xelaint changed the title [DOCS] Update daff-illuminate function Documentation [DOCS] Update daff-illuminate function documentation Aug 12, 2024
@xelaint
Copy link
Member Author

xelaint commented Feb 18, 2025

Possibly deprecate this function. Notes from daff-illuminate discussion:

// Returns a color 
// Smart switch a color with another color in the palette depending upon theme.
// Smart switch - 
$daff-????


"light" | 10 | (10,20..., 90) | 1 | 90

Theme Version (daff-switch-color-by-theme)
--
border: "dark" | (10,20..., 90) | 1 | 20
background: "dark" | (10,20..., 90) | 1 | 30

border: "light" | (10,20..., 90) | 1 | 90
background: "light" | (10,20..., 90) | 1 | 0

Color Version (similar to daff text contrast)
Given a color, give me back a text color.
daff-palette-contrast

// Given a color, give me back a color from the $palette that is "n" steps away in the opposite direction in the pallete for my color.
// For example, given a bright color, and a palette, this will give you a darker color in the given palette.
// Similarly, for example, given a dark color, and a palette, this will give you a brighter color in the given palette.
// This is especially useful for contrast text on top of a different color background. 
// Note, that this only works if your color palettes are perceptually uniform.
---
border: 10 | (10,20..., 90) | 1 | 20
background:  10 | (10,20..., 90) | 1 | 30

border: 10 | (10,20..., 90) | 1 | 90
background: 10 | (10,20..., 90) | 1 | 0

font-color: daff-text-contrast(color);

font-color: daff-text-contrast(color, $palette);

$color: daff-color(daff-map-get($theme, primary))
font-color: daff-text-contrast($color, $palette)
background: $color;

$color: daff-palette-contrast($theme, $palette, 1);  —> (spits out $primary, 10)
background: daff-palette-contrast($theme, $palette, 1);  —> (spits out $primary, 10 on light theme, spits out $primary, 90 on dark theme)
color: daff-text-contrast($color, $palette); —> (spits out opposite of $primary, 10)

daff-theme-aware-color($palette, 10) -> Gives the 90 on a dark theme, gives a 10 on a light theme.

// Revise Text-contrast api
// Create a new function called daff-theme-aware-color (internal only, not in public api)
// Potentially deprecate daff-illuminate after daff-theme-aware-color is finished
// Create a new function called daff-palette-contrast

Theme |  Color | Palette | "steps?" | Result |
-----
Light | A light green | Success Green Palette  | null |  |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is related to documentation p2 medium priority
Projects
Status: To do
Development

No branches or pull requests

2 participants