Skip to content

Commit

Permalink
Support placeholder color and opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Oyelowo committed Jan 17, 2025
1 parent 95c6f2a commit 6acd91f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions twust-macro/src/config/classes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,24 @@ define_tailwind_field!({
variants: []
});

// 3. Placeholder
// Placeholder Color
// Placeholder Opacity
define_tailwind_color_field!({
name: PlaceholderColor,
prefix: "placeholder-color",
field_name: placeholder_color,
variants: []
});

define_tailwind_field!({
name: PlaceholderOpacity,
prefix: "placeholder-opacity",
inherited: placeholder_opacity,
field_name: placeholder_opacity,
variants: []
});

// 3. Spacing
// Padding
// Margin
Expand Down
4 changes: 3 additions & 1 deletion twust-macro/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn get_classes(config: &TailwindConfig) -> Vec<String> {
// by the user.

let mut classes = Vec::new();
let utilities: [Box<dyn TailwindField>; 175] = [
let utilities: [Box<dyn TailwindField>; 177] = [
Box::new(AspectRatio),
Box::new(Container),
Box::new(Columns),
Expand Down Expand Up @@ -143,6 +143,8 @@ pub fn get_classes(config: &TailwindConfig) -> Vec<String> {
Box::new(PlaceContent),
Box::new(PlaceItems),
Box::new(PlaceSelf),
Box::new(PlaceholderColor),
Box::new(PlaceholderOpacity),
Box::new(Padding),
Box::new(Margin),
Box::new(SpaceBetween),
Expand Down
1 change: 1 addition & 0 deletions twust-macro/src/tailwind/default_classnames.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// placescreen_readers-shown
// placeholder-slate-400

#[allow(dead_code)]
#[derive(Debug, Clone, Copy)]
pub struct TailWindCssDefaultClassNames {
pub aspect_ratio: [&'static str; 3],
Expand Down

0 comments on commit 6acd91f

Please sign in to comment.