pub struct CssCandidateAction {
pub kind: CssCandidateActionType,
pub auto_fixable: bool,
pub description: String,
pub command: Option<String>,
}Expand description
A read-only verification step attached to a CSS cleanup candidate.
CSS candidates (unreferenced @keyframes, unused scoped classes) are never
auto-removed: an animation name can still be applied from JavaScript, and a
class can be assembled from a dynamic string binding. The action gives an
agent a machine-readable next step, mirroring the actions array carried by
every other health finding, plus an optional runnable probe to confirm the
candidate is genuinely unused before deleting it.
Fields§
§kind: CssCandidateActionTypeAction type identifier (verify-unused).
auto_fixable: boolAlways false: CSS candidates are never auto-fixed (fallow fix does
not touch them) because the residual consumer may live outside CSS.
description: StringHuman-readable description of what to confirm before removing.
command: Option<String>A runnable, read-only, placeholder-free token search that surfaces any
out-of-CSS use of the candidate. Absent when no shell-safe command can
be built (e.g. the residual risk is a dynamic string binding that a
single search cannot probe), in which case description is the guide.
Implementations§
Source§impl CssCandidateAction
impl CssCandidateAction
Sourcepub fn simplify_selector(reason: &str) -> Self
pub fn simplify_selector(reason: &str) -> Self
Read-only guidance for a selector / nesting / important-density finding.
Sourcepub fn verify_unused_font_face(family: &str) -> Self
pub fn verify_unused_font_face(family: &str) -> Self
Verify action for an unused @font-face family: a read-only token search
for any inline-style or JavaScript application of the family before
removing the dead web-font.
Sourcepub fn verify_unused_theme_token(
token: &str,
namespace: &str,
name: &str,
) -> Self
pub fn verify_unused_theme_token( token: &str, namespace: &str, name: &str, ) -> Self
Verify action for an unused Tailwind v4 @theme token: a read-only search
that embeds the LITERAL terms an agent should grep for, the generated
utility suffix (bg-<name> / text-<name> / <namespace>-<name>), the
var(--<ns>-<name>) read, and the arbitrary [--<ns>-<name>] value,
before removing the token. Verify-then-remove; never auto-fixable.
Sourcepub fn replace_near_duplicate_token(token: &str, nearest: &str) -> Self
pub fn replace_near_duplicate_token(token: &str, nearest: &str) -> Self
Guidance for a near-duplicate theme token: reuse the named existing token after checking semantic intent.
Sourcepub fn verify_unreferenced_class(name: &str) -> Self
pub fn verify_unreferenced_class(name: &str) -> Self
Verify action for an unreferenced global CSS class: name the surfaces the in-project scan does NOT cover (the class could be applied from there) and ship a read-only token search to double-check before removing.
Sourcepub fn verify_keyframe(name: &str) -> Self
pub fn verify_keyframe(name: &str) -> Self
Verify action for an unreferenced @keyframes: a read-only token search
for any JavaScript or template reference that applies the animation
(which the CSS-only scan cannot see).
Sourcepub fn verify_undefined_keyframe(name: &str) -> Self
pub fn verify_undefined_keyframe(name: &str) -> Self
Verify action for an animation reference to a @keyframes that is
defined in no stylesheet: a read-only token search for a CSS-in-JS
@keyframes/animation definition of the name (styled-components,
Emotion, vanilla-extract) before treating the reference as a typo.
Sourcepub fn standardize_notation(axis: &str, dominant: &str) -> Self
pub fn standardize_notation(axis: &str, dominant: &str) -> Self
Guidance action for a mixed value axis (colors authored in several notations, or font sizes in several units): standardize on the single dominant notation. No command (this is a project-wide refactor, and the per-notation breakdown already quantifies the spread); the residual judgment is whether the spread is an intentional migration in progress.
Sourcepub fn consolidate_block(occurrence_count: u32) -> Self
pub fn consolidate_block(occurrence_count: u32) -> Self
Guidance action for a duplicate declaration block: consolidate the shared declarations into one rule. No command (consolidation is a refactor, and the occurrences list already names every site); the residual judgment is whether the rules are intentionally separate overrides.
Sourcepub fn replace_arbitrary_value(value: &str) -> Self
pub fn replace_arbitrary_value(value: &str) -> Self
Action for a Tailwind arbitrary-value bypass: a read-only fixed-string
search for every occurrence of the token so it can be replaced with a
scale token (or confirmed an intentional one-off). The value is a Tailwind
utility token (no quotes / whitespace by construction), so it is safe to
single-quote; the -F keeps the [ / ] literal rather than a glob.
Sourcepub fn replace_cva_variant_arbitrary_value(
class_token: &str,
nearest: &str,
) -> Self
pub fn replace_cva_variant_arbitrary_value( class_token: &str, nearest: &str, ) -> Self
Guidance for a CVA / shadcn variant arbitrary value: replace the utility with a token-backed variant class after checking variant intent.
Sourcepub fn replace_raw_style_value(axis: &str, value: &str) -> Self
pub fn replace_raw_style_value(axis: &str, value: &str) -> Self
Guidance for a raw CSS value on a scale-sensitive axis: replace with an existing token or confirm the one-off is intentional.
Sourcepub fn verify_unused_at_rule(kind: UnusedAtRuleKind, name: &str) -> Self
pub fn verify_unused_at_rule(kind: UnusedAtRuleKind, name: &str) -> Self
Verify action for an unused CSS at-rule entity: a read-only search for
any out-of-CSS consumer (JS reading an @property; an @import layer()
populating a layer) before removing it.
Sourcepub fn verify_unresolved_class(class: &str, suggestion: &str) -> Self
pub fn verify_unresolved_class(class: &str, suggestion: &str) -> Self
Verify action for a markup class token that matches no defined CSS class but is one edit from a class that is defined: surface the suggestion and a read-only token search so the residual risk (a class defined in CSS-in-JS or an external stylesheet) can be ruled out before fixing the typo.
Sourcepub fn verify_scoped_classes() -> Self
pub fn verify_scoped_classes() -> Self
Verify action for a Vue SFC’s unused scoped classes. The component-scoped scan already covers every static use, so the only residual risk is a class assembled from a dynamic string; that is a manual check, so the action carries guidance but no command.