Skip to content

Commit

Permalink
improve preset structure
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniGuardiola committed Jan 22, 2024
1 parent 9144a65 commit 56c4478
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ pub enum UseSortedClassesPreset {
#[allow(unused)]
None,
#[default]
TailwindCSS, // TODO: should this be the default?
TailwindCSS,
}

const TAILWIND_PRESETS: [&str; 567] = [
// TAILWIND-COMPONENTS-LAYER-CLASSES-START
const UTILITIES_COMPONENTS_CLASSES: [&str; 1] = [
// TODO: auto-generated message
"container$",
];
// TAILWIND-COMPONENTS-LAYER-CLASSES-END

// TAILWIND-UTILITIES-LAYER-CLASSES-START
const UTILITIES_LAYER_CLASSES: [&str; 567] = [
// TODO: auto-generated message
"sr-only$",
"not-sr-only$",
"pointer-events-none$",
Expand Down Expand Up @@ -580,8 +589,8 @@ const TAILWIND_PRESETS: [&str; 567] = [
"forced-color-adjust-auto$",
"forced-color-adjust-none$",
];
// TAILWIND-UTILITIES-LAYER-CLASSES-END

// TODO: make this static
pub fn get_utilities_preset(preset: &UseSortedClassesPreset) -> UtilitiesConfig {
match preset {
UseSortedClassesPreset::None => {
Expand All @@ -592,11 +601,11 @@ pub fn get_utilities_preset(preset: &UseSortedClassesPreset) -> UtilitiesConfig
vec![
UtilityLayer {
name: String::from("components"),
classes: ["container$"].as_slice(),
classes: UTILITIES_COMPONENTS_CLASSES.as_slice(),
},
UtilityLayer {
name: String::from("utilities"),
classes: TAILWIND_PRESETS.as_slice(),
classes: UTILITIES_LAYER_CLASSES.as_slice(),
},
]
// TAILWIND-UTILITIES-PRESET-END
Expand Down

0 comments on commit 56c4478

Please sign in to comment.