Skip to content

Update card to support semantic variables#6809

Open
GZolla wants to merge 3 commits intomainfrom
gzolla/card-dark
Open

Update card to support semantic variables#6809
GZolla wants to merge 3 commits intomainfrom
gzolla/card-dark

Conversation

@GZolla
Copy link
Copy Markdown
Contributor

@GZolla GZolla commented Apr 16, 2026

@GZolla GZolla requested a review from a team as a code owner April 16, 2026 02:19
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for the PR! 🎉

We've deployed an automatic preview for this PR - you can see your changes here:

URL https://live.d2l.dev/prs/BrightspaceUI/core/pr-6809/

Note

The build needs to finish before your changes are deployed.
Changes to the PR will automatically update the instance.

Comment thread components/colors/colors.js Outdated

}

export function registerCustomSemanticVariableValue(name, lightValue, darkValue) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a double-edged sword, but unless we define all colors inside core I see consumers needing custom colors(e.g. lumi)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is a really slippery slope eh? If they can define there own colors, then it makes it really hard for us to make palette changes with confidence. Also, this requires that the consumer know the different color modes.

We've been having some discussion about the Lumi stuff. It still might be an issue, but I think the "AI colors" might get added to the semantic palette. There's also been some discussion of possibly adding a special button to core, given that AI is becoming more ubiquitous. But that's just the AI case. We also want to avoid multiple people each wanting some unique styles to highlight a new flashy feature, so there is also some discussion about generalizing that.

The Figma extract has a color for FACE background, but I did not include it because Jeff said it was somewhat experimental and we need to find a more general semantic for it. I think we should add this to the Confluence doc (as well as for d2l-collapsible-panel). I think there will be a color for it, it's just undefined atm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think we would need a way to programmatically set a custom variable. Not sure what we ended up deciding for color input but if we want to support users being able to set colors for both palettes we would need something like this helper

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the helper internal, I would hope consumers can see red flags when trying to import it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is just for demo at the moment, what do you think about just adding the variables that we anticipate, knowing that the name will likely change, and keeping this helper in our back pocket until we need it in non-demo/test code? The colors (from Figma) are currently defined as:

// light
--d2l-theme-background-color-face: var(--d2l-color-gypsum);
// dark
--d2l-theme-background-color-face: #303335;

I'd only excluded it earlier because we think it is going to be redefined, but it's really no different than the other variables we've added that we expect to change.

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.

2 participants