Skip to content

Support for styles to be overridden #2

@equidevium

Description

@equidevium

Most likely I will add support for styles to be overridden since it makes sense.

The idea is to use a pattern where each component accepts optional style override props that get merged with the defaults.

// Each component could accept an optional class override
#[props(into, default)]
class_override: Option<String>,

// Then in the component:
class: format!("{} {}", s::DEFAULT_STYLE, class_override.unwrap_or_default()),

This way the base Tailwind classes from _styles.rs always apply, and the consumer can append or override with additional classes. It is a lightweight "inheritance" without needing a whole style system, though it is worth thinking through which components benefit from this and which should stay opinionated.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions