Skip to content

feat(*): remove css variable exports #32

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

Merged
merged 4 commits into from
Jul 5, 2023
Merged

Conversation

adamdehaven
Copy link
Member

@adamdehaven adamdehaven commented Jul 4, 2023

Summary

The CSS variables in Kong's design system are meant to be used to allow for customization when used in standalone components so that a host application can customize values without having to fork the component package, etc.

This PR removes the CSS exports from the distributed package, as a host app should never need to import all variables already set to their default values.

Example

To use the CSS variables in a component that wants to allow for customization, the component code would look something like this:

<template>
  <button class="my-button">Click me</button>
</template>

<style lang="scss">
import '@kong/design-tokens/tokens/scss/variables';

.my-button {
  background-color: var(--kui-color-background-primary, $kui-color-background-primary);
}
</style>

The host application would then define an override value for the token above, optionally scoped within a wrapper class:

// Override everywhere
:root {
  --kui-color-background-primary: #007ac1;
}

// Or, override for a single container
.button-wrapper-element {
  --kui-color-background-primary: #007ac1;
}

PR Checklist

  • Tests pass: check the output of all package unit and/or component tests.
    • If this PR is the result of a bug, test coverage was added accordingly.
  • Conventional Commits all commits follow the conventional commit standards outlined in the main README.
  • Docs: includes a technically accurate README, and the docs have been updated accordingly based on the changes in this PR.

@adamdehaven adamdehaven self-assigned this Jul 4, 2023
@adamdehaven adamdehaven changed the title feat(*): remove css exports feat(*): remove css variable exports Jul 5, 2023
@adamdehaven adamdehaven merged commit 4fef2df into main Jul 5, 2023
@adamdehaven adamdehaven deleted the feat/remove-css-exports branch July 5, 2023 17:34
kongponents-bot pushed a commit that referenced this pull request Jul 5, 2023
# [1.3.0](v1.2.0...v1.3.0) (2023-07-05)

### Features

* remove css variable exports ([#32](#32)) ([4fef2df](4fef2df))
@kongponents-bot
Copy link
Collaborator

🎉 This PR is included in version 1.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants