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

Define a prefix for css and scss files #27

Open
rajsite opened this issue Jan 13, 2022 · 0 comments
Open

Define a prefix for css and scss files #27

rajsite opened this issue Jan 13, 2022 · 0 comments

Comments

@rajsite
Copy link

rajsite commented Jan 13, 2022

Is there a way to define a prefix for tokens that are built into css and scss files? Particularly for css and scss files the tokens get applied to the page globally so I would like to use a custom prefix with them.

For example instead of:

:root {
      --black: #000000;
}

I'd like to be able to set the prefix my-prefix and have the following:

:root {
      --my-prefix-black: #000000;
}

I'd also like to conditionally use the prefix. For example, the prefix isn't needed for JS files

rajsite added a commit to ni/nimble that referenced this issue Jan 13, 2022
# Pull Request

## 🤨 Rationale

This PR addresses the second half of #236 (comment) by adding the prefix `nimble-base` to the raw tokens defined in ni/tokens.

## 👩‍💻 Implementation

- Modified the nimble-extensions for the Adobe DSP to add a prefix to the names. Used a workaround as I couldn't see a way to configure a prefix using the DSP itself. I created the following issue for the workaround: AdobeXD/design-system-package-dsp#27
- Only defined the prefix for css and scss files. The rationale being that those are set globally in a page and can conflict. The JS files are modules that are explicitly imported and not globally available so are unlikely to get used accidentally.

## 🧪 Testing

Just CI builds, no explicit testing.

## ✅ Checklist

- [x] I have updated the project documentation to reflect my changes or determined no changes are needed. Doc changes will be aligned with #231 or after. Won't address in this PR.
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

No branches or pull requests

1 participant