pub struct TailwindDarkModeRule { /* private fields */ }Expand description
Enforces that hardcoded Tailwind color utilities always have a dark: counterpart.
For example, className="bg-white text-black" will be flagged because there
are no dark:bg-* or dark:text-* variants present. shadcn semantic token
classes like bg-background and text-foreground are allowed by default
because they resolve via CSS variables that already handle both themes.
This rule scans JSX/TSX/HTML files for class attributes and analyzes the Tailwind classes within them.
Implementations§
Source§impl TailwindDarkModeRule
impl TailwindDarkModeRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Rule for TailwindDarkModeRule
impl Rule for TailwindDarkModeRule
Auto Trait Implementations§
impl Freeze for TailwindDarkModeRule
impl RefUnwindSafe for TailwindDarkModeRule
impl Send for TailwindDarkModeRule
impl Sync for TailwindDarkModeRule
impl Unpin for TailwindDarkModeRule
impl UnsafeUnpin for TailwindDarkModeRule
impl UnwindSafe for TailwindDarkModeRule
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