Skip to content

Conversation

@adamwathan
Copy link
Member

This PR adds a new custom @prefix at-rule which works as a decorator for prefixing any nested class definitions:

@prefix 'tw-' {
  @tailwind utilities;
}

This makes it easy to generate all of Tailwind's utilities with a user-provided prefix to avoid collisions with any existing CSS they are using

@ghost
Copy link

ghost commented Nov 5, 2017

I love this idea, this would also close #92!

Also, why use an at-rule rather than a configuration option?

@regularlabs
Copy link

Maybe have both?
So a general prefix configuration option too.
If you set the configuration prefix option to foo- an then wrap stuff in @prefix 'bar-' {}, the classmames would become foo-bar-....

@adamwathan
Copy link
Member Author

Also, why use an at-rule rather than a configuration option?

Right now the config file doesn't contain any real "settings" or anything so to speak; it's more of a style guide or a definition of your design system.

Adding this there would make it the first time we've added that sort of configuration to that file and I'm not convinced I want to start mixing those two types of configuration in the same place.

Open to discussing it though; it would likely affect #99 as well, and any other proposals about "settings" like this, like tailwindlabs/discuss#27.

@regularlabs
Copy link

Mixing the style stuff with possible setting might indeed not be a good idea.
Solution could be to have them in a separate (optional) file.
Once you have the mechanism to control stuff with settings, you can think of all sorts of cool stuff to put in there in the future.

@regularlabs
Copy link

A different setting could be to control the format of the responsive prefixes (like mentioned in tailwindlabs/discuss#27), but also to choose whether to use that as a prefix or suffix.

Maybe settings to control LTR/RTL stuff.

@adamwathan
Copy link
Member Author

After a bunch of discussion I think we're going to do this in the config file. Gonna let this hang open until we get that implemented though.

@adamwathan
Copy link
Member Author

Closing this in favor of the config-based approach in #183.

@adamwathan adamwathan closed this Nov 14, 2017
@adamwathan adamwathan deleted the prefix-directive branch November 23, 2017 13:50
thecrypticace pushed a commit that referenced this pull request Sep 26, 2025
Here is everything you need to know about this upgrade. Please take a
good look at what changed and the test results before merging this pull
request.

### What changed?




#### ✳️ dedent (1.6.0 → 1.7.0) · [Repo](https://github.com/dmnd/dedent)
· [Changelog](https://github.com/dmnd/dedent/blob/main/CHANGELOG.md)



<details>
<summary>Release Notes</summary>
<h4><a
href="https://github.com/dmnd/dedent/releases/tag/v1.7.0">1.7.0</a></h4>

<blockquote><h2 dir="auto">What's Changed</h2>
<ul dir="auto">
<li>docs: cleaned up README.md badges by <a
href="https://bounce.depfu.com/github.com/JoshuaKGoldberg">@JoshuaKGoldberg</a>
in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/100">#100</a>
</li>
<li>feat: add alignValues option by <a
href="https://bounce.depfu.com/github.com/PaperStrike">@PaperStrike</a>
in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/102">#102</a>
</li>
<li>1.7.0 by <a
href="https://bounce.depfu.com/github.com/JoshuaKGoldberg">@JoshuaKGoldberg</a>
in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/103">#103</a>
</li>
</ul>
<h2 dir="auto">New Contributors</h2>
<ul dir="auto">
<li>
<a
href="https://bounce.depfu.com/github.com/PaperStrike">@PaperStrike</a>
made their first contribution in <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/pull/102">#102</a>
</li>
</ul>
<p dir="auto"><strong>Full Changelog</strong>: <a
href="https://bounce.depfu.com/github.com/dmnd/dedent/compare/v1.6.0...v1.7.0"><tt>v1.6.0...v1.7.0</tt></a></p></blockquote>
<p><em>Does any of this look wrong? <a
href="https://depfu.com/packages/npm/dedent/feedback">Please let us
know.</a></em></p>
</details>

<details>
<summary>Commits</summary>
<p><a
href="https://github.com/dmnd/dedent/compare/ab2ce25762a6ad0c26c563075f87c74427092d02...dd15cf58368b9842a256425a0f24cd7f8fd3df68">See
the full diff on Github</a>. The new version differs by 3 commits:</p>
<ul>
<li><a
href="https://github.com/dmnd/dedent/commit/dd15cf58368b9842a256425a0f24cd7f8fd3df68"><code>1.7.0
(#103)</code></a></li>
<li><a
href="https://github.com/dmnd/dedent/commit/304d0fc79567ef62da296b213525589ade7a711e"><code>feat:
add alignValues option (#102)</code></a></li>
<li><a
href="https://github.com/dmnd/dedent/commit/aab442c691ba3608a5401df57b5e817533c9eed0"><code>docs:
cleaned up README.md badges (#100)</code></a></li>
</ul>
</details>












---
![Depfu
Status](https://depfu.com/badges/edd6acd35d74c8d41cbb540c30442adf/stats.svg)

[Depfu](https://depfu.com) will automatically keep this PR
conflict-free, as long as you don't add any commits to this branch
yourself. You can also trigger a rebase manually by commenting with
`@depfu rebase`.

<details><summary>All Depfu comment commands</summary>
<blockquote><dl>
<dt>@​depfu rebase</dt><dd>Rebases against your default branch and
redoes this update</dd>
<dt>@​depfu recreate</dt><dd>Recreates this PR, overwriting any edits
that you've made to it</dd>
<dt>@​depfu merge</dt><dd>Merges this PR once your tests are passing and
conflicts are resolved</dd>
<dt>@​depfu cancel merge</dt><dd>Cancels automatic merging of this
PR</dd>
<dt>@​depfu close</dt><dd>Closes this PR and deletes the branch</dd>
<dt>@​depfu reopen</dt><dd>Restores the branch and reopens this PR (if
it's closed)</dd>
<dt>@​depfu pause</dt><dd>Ignores all future updates for this dependency
and closes this PR</dd>
<dt>@​depfu pause [minor|major]</dt><dd>Ignores all future minor/major
updates for this dependency and closes this PR</dd>
<dt>@​depfu resume</dt><dd>Future versions of this dependency will
create PRs again (leaves this PR as is)</dd>
</dl></blockquote>
</details>

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
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.

3 participants