pub struct TailwindThemeTokensRule { /* private fields */ }Expand description
Enforces usage of shadcn/ui semantic token classes instead of raw Tailwind color utilities.
In a properly themed shadcn project, you should use classes like bg-background,
text-foreground, bg-muted, border-border etc. that resolve to CSS custom
properties — not raw Tailwind colors like bg-white, text-gray-900, border-slate-200.
This rule catches raw color classes and suggests the semantic replacement.
By default it ships with a comprehensive mapping. You can extend or override
it via the token_map config field: ["bg-white=bg-background", "text-black=text-foreground"].
Implementations§
Source§impl TailwindThemeTokensRule
impl TailwindThemeTokensRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Rule for TailwindThemeTokensRule
impl Rule for TailwindThemeTokensRule
Auto Trait Implementations§
impl Freeze for TailwindThemeTokensRule
impl RefUnwindSafe for TailwindThemeTokensRule
impl Send for TailwindThemeTokensRule
impl Sync for TailwindThemeTokensRule
impl Unpin for TailwindThemeTokensRule
impl UnsafeUnpin for TailwindThemeTokensRule
impl UnwindSafe for TailwindThemeTokensRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more