From de0d1e95b8f75349a1d6b085bde4f644e9d75e35 Mon Sep 17 00:00:00 2001 From: Dmitrii Shatokhin Date: Sat, 2 Nov 2024 00:17:38 +0100 Subject: [PATCH] feat: enhance components init - Optimized component initialization to improve performance by running it only once. - Restructured components for greater flexibility. - Added a two-way dictionary to support both full and shorthand syntax options. --- src/core/component.rs | 604 ++++++++++++++++++++++++++++++++++++++ src/core/css_generator.rs | 484 +----------------------------- src/core/mod.rs | 1 + src/core/parser.rs | 9 +- 4 files changed, 610 insertions(+), 488 deletions(-) create mode 100644 src/core/component.rs diff --git a/src/core/component.rs b/src/core/component.rs new file mode 100644 index 0000000..9a22ab9 --- /dev/null +++ b/src/core/component.rs @@ -0,0 +1,604 @@ +//! This module provides mappings between CSS properties and their abbreviations (short syntax). +//! +//! It allows for retrieving the full CSS property name given either the full name or its abbreviation, +//! as well as retrieving the abbreviation given the full name. +//! +//! The module also provides a list of all components (full names and abbreviations). + +use once_cell::sync::Lazy; +use std::collections::HashMap; + +/// A list of tuples containing CSS property full names and their abbreviations. +static PROPERTIES: &[(&str, &str)] = &[ + ("accent-color", "acc"), + ("align-content", "ac"), + ("align-items", "ai"), + ("align-self", "as"), + ("align-tracks", "atr"), + ("all", "all"), + ("anchor-name", "anc-n"), + ("anchor-scope", "anc-s"), + ("animation", "anim"), + ("animation-composition", "anim-comp"), + ("animation-delay", "anim-d"), + ("animation-direction", "anim-dir"), + ("animation-duration", "anim-du"), + ("animation-fill-mode", "anim-fm"), + ("animation-iteration-count", "anim-ic"), + ("animation-name", "anim-n"), + ("animation-play-state", "anim-ps"), + ("animation-range", "anim-r"), + ("animation-range-end", "anim-re"), + ("animation-range-start", "anim-rs"), + ("animation-timeline", "at"), + ("animation-timing-function", "atf"), + ("animationType", "atype"), + ("appearance", "app"), + ("appliesto", "applies"), + ("aspect-ratio", "ar"), + ("azimuth", "az"), + ("backdrop-filter", "bf"), + ("backface-visibility", "bvis"), + ("background", "bg"), + ("background-attachment", "bga"), + ("background-blend-mode", "bgblm"), + ("background-clip", "bg-cl"), + ("background-color", "bgc"), + ("background-image", "bgi"), + ("background-origin", "bgo"), + ("background-position", "bgp"), + ("background-position-x", "bgpx"), + ("background-position-y", "bgpy"), + ("background-repeat", "bgr"), + ("background-size", "bgsz"), + ("block-size", "bsz"), + ("border", "b"), + ("border-block", "bb"), + ("border-block-color", "bbc"), + ("border-block-end", "bbe"), + ("border-block-end-color", "bbec"), + ("border-block-end-style", "bbes"), + ("border-block-end-width", "bbew"), + ("border-block-start", "bbs"), + ("border-block-start-color", "bbsc"), + ("border-block-start-style", "bbss"), + ("border-block-start-width", "bbsw"), + ("border-block-style", "bbs"), + ("border-block-width", "bbw"), + ("border-bottom", "bb"), + ("border-bottom-color", "bbc"), + ("border-bottom-left-radius", "bblr"), + ("border-bottom-right-radius", "bbrr"), + ("border-bottom-style", "bbs"), + ("border-bottom-width", "bbw"), + ("border-collapse", "bcoll"), + ("border-color", "bc"), + ("border-end-end-radius", "beer"), + ("border-end-start-radius", "besr"), + ("border-image", "bi"), + ("border-image-outset", "bio"), + ("border-image-repeat", "bir"), + ("border-image-slice", "bis"), + ("border-image-source", "bisrc"), + ("border-image-width", "biw"), + ("border-inline", "bli"), + ("border-inline-color", "blic"), + ("border-inline-end", "blie"), + ("border-inline-end-color", "bliec"), + ("border-inline-end-style", "blies"), + ("border-inline-end-width", "bliew"), + ("border-inline-start", "blis"), + ("border-inline-start-color", "blisc"), + ("border-inline-start-style", "bliss"), + ("border-inline-start-width", "blisw"), + ("border-inline-style", "blis"), + ("border-inline-width", "bliw"), + ("border-left", "bl"), + ("border-left-color", "blc"), + ("border-left-style", "bls"), + ("border-left-width", "blw"), + ("border-radius", "br"), + ("border-right", "brt"), + ("border-right-color", "brc"), + ("border-right-style", "brs"), + ("border-right-width", "brw"), + ("border-spacing", "bsp"), + ("border-start-end-radius", "bser"), + ("border-start-start-radius", "bssr"), + ("border-style", "bst"), + ("border-top", "bt"), + ("border-top-color", "btc"), + ("border-top-left-radius", "btlr"), + ("border-top-right-radius", "btrr"), + ("border-top-style", "bts"), + ("border-top-width", "btw"), + ("border-width", "bw"), + ("bottom", "btm"), + ("box-align", "bxa"), + ("box-decoration-break", "bxdb"), + ("box-direction", "bxd"), + ("box-flex", "bxf"), + ("box-flex-group", "bxfg"), + ("box-lines", "bxl"), + ("box-ordinal-group", "bxog"), + ("box-orient", "bxo"), + ("box-pack", "bxp"), + ("box-shadow", "bxsh"), + ("box-sizing", "bxs"), + ("break-after", "ba"), + ("break-before", "bb"), + ("break-inside", "bi"), + ("caption-side", "cs"), + ("caret", "crt"), + ("caret-color", "cc"), + ("caret-shape", "cs"), + ("clear", "clr"), + ("clip", "clp"), + ("clip-path", "clpp"), + ("color", "c"), + ("color-scheme", "csch"), + ("column-count", "ccnt"), + ("column-fill", "cf"), + ("column-gap", "cg"), + ("column-rule", "cr"), + ("column-rule-color", "crc"), + ("column-rule-style", "crs"), + ("column-rule-width", "crw"), + ("column-span", "csn"), + ("column-width", "cw"), + ("columns", "cols"), + ("computed", "cmp"), + ("contain", "cntn"), + ("contain-intrinsic-block-size", "cibs"), + ("contain-intrinsic-height", "cih"), + ("contain-intrinsic-inline-size", "ciis"), + ("contain-intrinsic-size", "cis"), + ("contain-intrinsic-width", "ciw"), + ("container", "ctr"), + ("container-name", "ctrn"), + ("container-type", "ctrt"), + ("content", "cnt"), + ("content-visibility", "cntv"), + ("counter-increment", "cinc"), + ("counter-reset", "crst"), + ("counter-set", "cset"), + ("cursor", "cur"), + ("direction", "dir"), + ("display", "d"), + ("empty-cells", "ec"), + ("field-sizing", "fsz"), + ("filter", "flt"), + ("flex", "flx"), + ("flex-basis", "flxb"), + ("flex-direction", "flex-dir"), + ("flex-flow", "flex-fl"), + ("flex-grow", "flex-gr"), + ("flex-shrink", "flex-sh"), + ("flex-wrap", "flex-wr"), + ("float", "flt"), + ("font", "fnt"), + ("font-family", "ff"), + ("font-feature-settings", "ffs"), + ("font-kerning", "fk"), + ("font-language-override", "flo"), + ("font-optical-sizing", "fos"), + ("font-palette", "fp"), + ("font-size", "fs"), + ("font-size-adjust", "fsa"), + ("font-smooth", "fsm"), + ("font-stretch", "fstr"), + ("font-style", "fsty"), + ("font-synthesis", "fsyn"), + ("font-synthesis-position", "fsynp"), + ("font-synthesis-small-caps", "fssc"), + ("font-synthesis-style", "fss"), + ("font-synthesis-weight", "fsw"), + ("font-variant", "fv"), + ("font-variant-alternates", "fva"), + ("font-variant-caps", "fvc"), + ("font-variant-east-asian", "fvea"), + ("font-variant-emoji", "fve"), + ("font-variant-ligatures", "fvl"), + ("font-variant-numeric", "fvn"), + ("font-variant-position", "fvp"), + ("font-variation-settings", "fvs"), + ("font-weight", "fw"), + ("forced-color-adjust", "fca"), + ("gap", "g"), + ("grid", "gr"), + ("grid-area", "gra"), + ("grid-auto-columns", "grac"), + ("grid-auto-flow", "graf"), + ("grid-auto-rows", "grar"), + ("grid-column", "gc"), + ("grid-column-end", "gce"), + ("grid-column-gap", "gcg"), + ("grid-column-start", "gcs"), + ("grid-gap", "gg"), + ("grid-row", "gr"), + ("grid-row-end", "gre"), + ("grid-row-gap", "grg"), + ("grid-row-start", "grs"), + ("grid-template", "gt"), + ("grid-template-areas", "gta"), + ("grid-template-columns", "gtc"), + ("grid-template-rows", "gtr"), + ("groups", "grps"), + ("hanging-punctuation", "hp"), + ("height", "h"), + ("hyphenate-character", "hc"), + ("hyphenate-limit-chars", "hlc"), + ("hyphens", "hy"), + ("image-orientation", "io"), + ("image-rendering", "imgr"), + ("image-resolution", "imgres"), + ("ime-mode", "im"), + ("inherited", "inh"), + ("initial", "init"), + ("initial-letter", "initl"), + ("initial-letter-align", "initla"), + ("inline-size", "insz"), + ("input-security", "inps"), + ("inset", "in"), + ("inset-area", "ina"), + ("inset-block", "inb"), + ("inset-block-end", "inbe"), + ("inset-block-start", "inbs"), + ("inset-inline", "ini"), + ("inset-inline-end", "inie"), + ("inset-inline-start", "inis"), + ("isolation", "iso"), + ("justify-content", "jc"), + ("justify-items", "ji"), + ("justify-self", "js"), + ("justify-tracks", "jt"), + ("left", "l"), + ("letter-spacing", "ls"), + ("line-break", "lb"), + ("line-clamp", "lc"), + ("line-height", "lh"), + ("line-height-step", "lhs"), + ("list-style", "ls"), + ("list-style-image", "lsi"), + ("list-style-position", "lsp"), + ("list-style-type", "lst"), + ("margin", "m"), + ("margin-block", "mb"), + ("margin-block-end", "mbe"), + ("margin-block-start", "mbs"), + ("margin-bottom", "mb"), + ("margin-inline", "mi"), + ("margin-inline-end", "mie"), + ("margin-inline-start", "mis"), + ("margin-left", "ml"), + ("margin-right", "mr"), + ("margin-top", "mt"), + ("margin-trim", "mtrim"), + ("mask", "mask"), + ("mask-border", "mask-b"), + ("mask-border-mode", "mask-bm"), + ("mask-border-outset", "mask-bo"), + ("mask-border-repeat", "mask-br"), + ("mask-border-slice", "mask-bs"), + ("mask-border-source", "mask-bsou"), + ("mask-border-width", "mask-bw"), + ("mask-clip", "mask-c"), + ("mask-composite", "mask-comp"), + ("mask-image", "mask-i"), + ("mask-mode", "mask-m"), + ("mask-origin", "mask-o"), + ("mask-position", "mask-pos"), + ("mask-repeat", "mask-r"), + ("mask-size", "mask-sz"), + ("mask-type", "mask-t"), + ("masonry-auto-flow", "mas-af"), + ("math-depth", "math-d"), + ("math-shift", "math-s"), + ("math-style", "math-st"), + ("max-block-size", "max-bs"), + ("max-height", "max-h"), + ("max-inline-size", "max-is"), + ("max-lines", "max-l"), + ("max-width", "max-w"), + ("mdn_url", "mdn-u"), + ("media", "med"), + ("min-block-size", "min-bs"), + ("min-height", "min-h"), + ("min-inline-size", "min-is"), + ("min-width", "min-w"), + ("mix-blend-mode", "mbm"), + ("object-fit", "obj-fit"), + ("object-position", "obj-pos"), + ("offset", "off"), + ("offset-anchor", "ofa"), + ("offset-distance", "ofd"), + ("offset-path", "ofp"), + ("offset-position", "ofpos"), + ("offset-rotate", "ofr"), + ("opacity", "op"), + ("order", "ord"), + ("orphans", "orphan"), + ("outline", "out"), + ("outline-color", "outc"), + ("outline-offset", "outo"), + ("outline-style", "outs"), + ("outline-width", "outw"), + ("overflow", "ov"), + ("overflow-anchor", "ova"), + ("overflow-block", "ovb"), + ("overflow-clip-box", "ovcb"), + ("overflow-clip-margin", "ovcm"), + ("overflow-inline", "ovi"), + ("overflow-wrap", "ovw"), + ("overflow-x", "ovx"), + ("overflow-y", "ovy"), + ("overlay", "overlay"), + ("overscroll-behavior", "ovsb"), + ("overscroll-behavior-block", "ovsb-b"), + ("overscroll-behavior-inline", "ovsb-i"), + ("overscroll-behavior-x", "ovsbx"), + ("overscroll-behavior-y", "ovsby"), + ("padding", "p"), + ("padding-block", "pb"), + ("padding-block-end", "pbe"), + ("padding-block-start", "pbs"), + ("padding-bottom", "pb"), + ("padding-inline", "pi"), + ("padding-inline-end", "pie"), + ("padding-inline-start", "pis"), + ("padding-left", "pl"), + ("padding-right", "pr"), + ("padding-top", "pt"), + ("page", "page"), + ("page-break-after", "pba"), + ("page-break-before", "pbb"), + ("page-break-inside", "pbi"), + ("paint-order", "po"), + ("percentages", "pct"), + ("perspective", "pers"), + ("perspective-origin", "pers-or"), + ("place-content", "pc"), + ("place-items", "pi"), + ("place-self", "ps"), + ("pointer-events", "pe"), + ("position", "pos"), + ("position-anchor", "pos-anch"), + ("position-try", "pos-try"), + ("position-try-options", "pos-try-opt"), + ("position-try-order", "pos-try-ord"), + ("position-visibility", "pos-vis"), + ("print-color-adjust", "pca"), + ("quotes", "q"), + ("resize", "rsz"), + ("right", "r"), + ("rotate", "rot"), + ("row-gap", "rg"), + ("ruby-align", "ra"), + ("ruby-merge", "rm"), + ("ruby-position", "rp"), + ("scale", "sc"), + ("scroll-behavior", "sb"), + ("scroll-margin", "sm"), + ("scroll-margin-block", "smb"), + ("scroll-margin-block-end", "smbe"), + ("scroll-margin-block-start", "smbs"), + ("scroll-margin-bottom", "smbt"), + ("scroll-margin-inline", "smi"), + ("scroll-margin-inline-end", "smie"), + ("scroll-margin-inline-start", "smis"), + ("scroll-margin-left", "sml"), + ("scroll-margin-right", "smr"), + ("scroll-margin-top", "smt"), + ("scroll-padding", "sp"), + ("scroll-padding-block", "spb"), + ("scroll-padding-block-end", "spbe"), + ("scroll-padding-block-start", "spbs"), + ("scroll-padding-bottom", "spbot"), + ("scroll-padding-inline", "spi"), + ("scroll-padding-inline-end", "spie"), + ("scroll-padding-inline-start", "spis"), + ("scroll-padding-left", "spl"), + ("scroll-padding-right", "spr"), + ("scroll-padding-top", "spt"), + ("scroll-snap-align", "ssa"), + ("scroll-snap-coordinate", "ssc"), + ("scroll-snap-destination", "ssd"), + ("scroll-snap-points-x", "sspx"), + ("scroll-snap-points-y", "sspy"), + ("scroll-snap-stop", "sss"), + ("scroll-snap-type", "sst"), + ("scroll-snap-type-x", "sstx"), + ("scroll-snap-type-y", "ssty"), + ("scroll-timeline", "stl"), + ("scroll-timeline-axis", "sta"), + ("scroll-timeline-name", "stn"), + ("scrollbar-color", "sc"), + ("scrollbar-gutter", "sg"), + ("scrollbar-width", "sw"), + ("shape-image-threshold", "sit"), + ("shape-margin", "sm"), + ("shape-outside", "so"), + ("stacking", "stk"), + ("status", "sts"), + ("syntax", "syn"), + ("tab-size", "ts"), + ("table-layout", "tl"), + ("text-align", "ta"), + ("text-align-last", "tal"), + ("text-combine-upright", "tcu"), + ("text-decoration", "td"), + ("text-decoration-color", "tdc"), + ("text-decoration-line", "tdl"), + ("text-decoration-skip", "tds"), + ("text-decoration-skip-ink", "tdsi"), + ("text-decoration-style", "tdst"), + ("text-decoration-thickness", "tdth"), + ("text-emphasis", "te"), + ("text-emphasis-color", "tec"), + ("text-emphasis-position", "tep"), + ("text-emphasis-style", "tes"), + ("text-indent", "ti"), + ("text-justify", "tj"), + ("text-orientation", "to"), + ("text-overflow", "tov"), + ("text-rendering", "tr"), + ("text-shadow", "tsh"), + ("text-size-adjust", "tsa"), + ("text-spacing-trim", "tst"), + ("text-transform", "tt"), + ("text-underline-offset", "tuo"), + ("text-underline-position", "tup"), + ("text-wrap", "tw"), + ("text-wrap-mode", "twm"), + ("text-wrap-style", "tws"), + ("timeline-scope", "tls"), + ("top", "t"), + ("touch-action", "ta"), + ("transform", "tf"), + ("transform-box", "tfb"), + ("transform-origin", "tfo"), + ("transform-style", "tfs"), + ("transition", "tr"), + ("transition-behavior", "trb"), + ("transition-delay", "trd"), + ("transition-duration", "trdu"), + ("transition-property", "trp"), + ("transition-timing-function", "trtf"), + ("translate", "tl"), + ("unicode-bidi", "ub"), + ("user-select", "us"), + ("vertical-align", "va"), + ("view-timeline", "vt"), + ("view-timeline-axis", "vta"), + ("view-timeline-inset", "vti"), + ("view-timeline-name", "vtn"), + ("view-transition-name", "vtrn"), + ("visibility", "vis"), + ("white-space", "ws"), + ("white-space-collapse", "wsc"), + ("widows", "wdw"), + ("width", "w"), + ("will-change", "wc"), + ("word-break", "wb"), + ("word-spacing", "wsp"), + ("word-wrap", "ww"), + ("writing-mode", "wm"), + ("z-index", "z"), + ("zoom", "zm"), + // --- CUSTOM --- + // generate built-in animation with all predefined rules + ("g-anim", "g-anim"), +]; + +/// A HashMap mapping both full names and abbreviations to the full CSS property names. +static COMPONENTS_MAP: Lazy> = Lazy::new(|| { + let mut m = HashMap::new(); + for &(full_name, abbreviation) in PROPERTIES.iter() { + m.insert(full_name, full_name); + m.insert(abbreviation, full_name); + } + m +}); + +/// A HashMap mapping full CSS property names to their abbreviations. +static FULL_TO_SHORT_MAP: Lazy> = + Lazy::new(|| PROPERTIES.iter().cloned().collect()); + +/// A list of all component strings (full names and abbreviations). +static ALL_COMPONENTS: Lazy> = + Lazy::new(|| COMPONENTS_MAP.keys().cloned().collect()); + +/// Gets the full CSS property name corresponding to the given component string. +/// +/// The component string can be either the full CSS property name or its abbreviation. +/// +/// # Arguments +/// +/// * `component_str` - The component string to look up. +/// +/// # Returns +/// +/// * `Option<&'static str>` - The full CSS property name if found, or `None` if not found. +pub fn get_css_property(component_str: &str) -> Option<&'static str> { + COMPONENTS_MAP.get(component_str).cloned() +} + +/// Gets the abbreviation for a given full CSS property name. +/// +/// # Arguments +/// +/// * `full_name` - The full CSS property name. +/// +/// # Returns +/// +/// * `Option<&'static str>` - The abbreviation if found, or `None` if not found. +pub fn get_shorten_component(full_name: &str) -> Option<&'static str> { + FULL_TO_SHORT_MAP.get(full_name).cloned() +} + +/// Gets a list of all components (both full CSS property names and their abbreviations). +/// +/// # Returns +/// +/// * `&'static [&'static str]` - A slice containing all component strings. +pub fn get_all_components() -> &'static [&'static str] { + ALL_COMPONENTS.as_slice() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_get_css_property_full_name() { + assert_eq!(get_css_property("accent-color"), Some("accent-color")); + assert_eq!(get_css_property("align-items"), Some("align-items")); + } + + #[test] + fn test_get_css_property_abbreviation() { + assert_eq!(get_css_property("acc"), Some("accent-color")); + assert_eq!(get_css_property("ai"), Some("align-items")); + } + + #[test] + fn test_get_css_property_unknown() { + assert_eq!(get_css_property("unknown"), None); + assert_eq!(get_css_property("xyz"), None); + } + + #[test] + fn test_get_shorten_component() { + assert_eq!(get_shorten_component("accent-color"), Some("acc")); + assert_eq!(get_shorten_component("align-items"), Some("ai")); + } + + #[test] + fn test_get_shorten_component_unknown() { + assert_eq!(get_shorten_component("unknown-property"), None); + assert_eq!(get_shorten_component("acc"), None); // "acc" is an abbreviation, not a full name + } + + #[test] + fn test_get_all_components() { + let components = get_all_components(); + assert!(components.contains(&"accent-color")); + assert!(components.contains(&"acc")); + assert!(components.contains(&"align-items")); + assert!(components.contains(&"ai")); + assert!(!components.contains(&"unknown")); + } + + #[test] + fn test_get_css_property_case_sensitive() { + // Ensure that the lookup is case-sensitive + assert_eq!(get_css_property("Acc"), None); + assert_eq!(get_css_property("ACC"), None); + } + + #[test] + fn test_get_shorten_component_case_sensitive() { + assert_eq!(get_shorten_component("Accent-Color"), None); + assert_eq!(get_shorten_component("ACCENT-COLOR"), None); + } +} diff --git a/src/core/css_generator.rs b/src/core/css_generator.rs index 9e47ca2..70b899c 100644 --- a/src/core/css_generator.rs +++ b/src/core/css_generator.rs @@ -21,6 +21,7 @@ use crate::buffer::add_message; use super::animations::ANIMATIONS; +use super::component::get_css_property; use super::{config::Config, spell::Spell, GrimoireCSSError}; use regex::Regex; use std::collections::HashMap; @@ -85,488 +86,7 @@ impl<'a> CSSGenerator<'a> { // css custom properties support Some(component_str) } else { - match component_str { - "accent-color" | "acc" => Some("accent-color"), - "align-content" | "ac" => Some("align-content"), - "align-items" | "ai" => Some("align-items"), - "align-self" | "as" => Some("align-self"), - "align-tracks" | "atr" => Some("align-tracks"), - "all" => Some("all"), - "anchor-name" | "anc-n" => Some("anchor-name"), - "anchor-scope" | "anc-s" => Some("anchor-scope"), - "animation" | "anim" => Some("animation"), - "animation-composition" | "anim-comp" => Some("animation-composition"), - "animation-delay" | "anim-d" => Some("animation-delay"), - "animation-direction" | "anim-dir" => Some("animation-direction"), - "animation-duration" | "anim-du" => Some("animation-duration"), - "animation-fill-mode" | "anim-fm" => Some("animation-fill-mode"), - "animation-iteration-count" | "anim-ic" => Some("animation-iteration-count"), - "animation-name" | "anim-n" => Some("animation-name"), - "animation-play-state" | "anim-ps" => Some("animation-play-state"), - "animation-range" | "anim-r" => Some("animation-range"), - "animation-range-end" | "anim-re" => Some("animation-range-end"), - "animation-range-start" | "anim-rs" => Some("animation-range-start"), - "animation-timeline" | "at" => Some("animation-timeline"), - "animation-timing-function" | "atf" => Some("animation-timing-function"), - "animationType" | "atype" => Some("animationType"), - "appearance" | "app" => Some("appearance"), - "appliesto" | "applies" => Some("appliesto"), - "aspect-ratio" | "ar" => Some("aspect-ratio"), - "azimuth" | "az" => Some("azimuth"), - "backdrop-filter" | "bf" => Some("backdrop-filter"), - "backface-visibility" | "bvis" => Some("backface-visibility"), - "background" | "bg" => Some("background"), - "background-attachment" | "bga" => Some("background-attachment"), - "background-blend-mode" | "bgblm" => Some("background-blend-mode"), - "background-clip" | "bgclip" => Some("background-clip"), - "background-color" | "bgc" => Some("background-color"), - "background-image" | "bgi" => Some("background-image"), - "background-origin" | "bgo" => Some("background-origin"), - "background-position" | "bgp" => Some("background-position"), - "background-position-x" | "bgpx" => Some("background-position-x"), - "background-position-y" | "bgpy" => Some("background-position-y"), - "background-repeat" | "bgr" => Some("background-repeat"), - "background-size" | "bgsz" => Some("background-size"), - "block-size" | "bsz" => Some("block-size"), - "border" | "b" => Some("border"), - "border-block" | "bblk" => Some("border-block"), - "border-block-color" | "bblk-c" => Some("border-block-color"), - "border-block-end" | "bbe" => Some("border-block-end"), - "border-block-end-color" | "bbec" => Some("border-block-end-color"), - "border-block-end-style" | "bbes" => Some("border-block-end-style"), - "border-block-end-width" | "bbew" => Some("border-block-end-width"), - "border-block-start" | "bblk-s" => Some("border-block-start"), - "border-block-start-color" | "bbsc" => Some("border-block-start-color"), - "border-block-start-style" | "bbss" => Some("border-block-start-style"), - "border-block-start-width" | "bbsw" => Some("border-block-start-width"), - "border-block-style" | "bblk-sty" => Some("border-block-style"), - "border-block-width" | "bblk-w" => Some("border-block-width"), - "border-bottom" | "bbtm" => Some("border-bottom"), - "border-bottom-color" | "bbtm-c" => Some("border-bottom-color"), - "border-bottom-left-radius" | "bblr" => Some("border-bottom-left-radius"), - "border-bottom-right-radius" | "bbrr" => Some("border-bottom-right-radius"), - "border-bottom-style" | "bbtm-sty" => Some("border-bottom-style"), - "border-bottom-width" | "bbtm-w" => Some("border-bottom-width"), - "border-collapse" | "bcoll" => Some("border-collapse"), - "border-color" | "bc" => Some("border-color"), - "border-end-end-radius" | "beer" => Some("border-end-end-radius"), - "border-end-start-radius" | "besr" => Some("border-end-start-radius"), - "border-image" | "bi" => Some("border-image"), - "border-image-outset" | "bio" => Some("border-image-outset"), - "border-image-repeat" | "bir" => Some("border-image-repeat"), - "border-image-slice" | "bis" => Some("border-image-slice"), - "border-image-source" | "bisrc" => Some("border-image-source"), - "border-image-width" | "biw" => Some("border-image-width"), - "border-inline" | "bli" => Some("border-inline"), - "border-inline-color" | "blic" => Some("border-inline-color"), - "border-inline-end" | "blie" => Some("border-inline-end"), - "border-inline-end-color" | "bliec" => Some("border-inline-end-color"), - "border-inline-end-style" | "blies" => Some("border-inline-end-style"), - "border-inline-end-width" | "bliew" => Some("border-inline-end-width"), - "border-inline-start" | "blis" => Some("border-inline-start"), - "border-inline-start-color" | "blisc" => Some("border-inline-start-color"), - "border-inline-start-style" | "bliss" => Some("border-inline-start-style"), - "border-inline-start-width" | "blisw" => Some("border-inline-start-width"), - "border-inline-style" | "blin-sty" => Some("border-inline-style"), - "border-inline-width" | "bliw" => Some("border-inline-width"), - "border-left" | "bl" => Some("border-left"), - "border-left-color" | "blc" => Some("border-left-color"), - "border-left-style" | "bls" => Some("border-left-style"), - "border-left-width" | "blw" => Some("border-left-width"), - "border-radius" | "br" => Some("border-radius"), - "border-right" | "brt" => Some("border-right"), - "border-right-color" | "brc" => Some("border-right-color"), - "border-right-style" | "brs" => Some("border-right-style"), - "border-right-width" | "brw" => Some("border-right-width"), - "border-spacing" | "bsp" => Some("border-spacing"), - "border-start-end-radius" | "bser" => Some("border-start-end-radius"), - "border-start-start-radius" | "bssr" => Some("border-start-start-radius"), - "border-style" | "bst" => Some("border-style"), - "border-top" | "bt" => Some("border-top"), - "border-top-color" | "btc" => Some("border-top-color"), - "border-top-left-radius" | "btlr" => Some("border-top-left-radius"), - "border-top-right-radius" | "btrr" => Some("border-top-right-radius"), - "border-top-style" | "bts" => Some("border-top-style"), - "border-top-width" | "btw" => Some("border-top-width"), - "border-width" | "bw" => Some("border-width"), - "bottom" | "btm" => Some("bottom"), - "box-align" | "bxa" => Some("box-align"), - "box-decoration-break" | "bxdb" => Some("box-decoration-break"), - "box-direction" | "bxd" => Some("box-direction"), - "box-flex" | "bxf" => Some("box-flex"), - "box-flex-group" | "bxfg" => Some("box-flex-group"), - "box-lines" | "bxl" => Some("box-lines"), - "box-ordinal-group" | "bxog" => Some("box-ordinal-group"), - "box-orient" | "bxo" => Some("box-orient"), - "box-pack" | "bxp" => Some("box-pack"), - "box-shadow" | "bxsh" => Some("box-shadow"), - "box-sizing" | "bxs" => Some("box-sizing"), - "break-after" | "ba" => Some("break-after"), - "break-before" | "brkbf" => Some("break-before"), - "break-inside" | "brkin" => Some("break-inside"), - "caption-side" | "capside" => Some("caption-side"), - "caret" | "crt" => Some("caret"), - "caret-color" | "cc" => Some("caret-color"), - "caret-shape" | "carshp" => Some("caret-shape"), - "clear" | "clr" => Some("clear"), - "clip" | "clp" => Some("clip"), - "clip-path" | "clpp" => Some("clip-path"), - "color" | "c" => Some("color"), - "color-scheme" | "csch" => Some("color-scheme"), - "column-count" | "ccnt" => Some("column-count"), - "column-fill" | "cf" => Some("column-fill"), - "column-gap" | "cg" => Some("column-gap"), - "column-rule" | "cr" => Some("column-rule"), - "column-rule-color" | "crc" => Some("column-rule-color"), - "column-rule-style" | "crs" => Some("column-rule-style"), - "column-rule-width" | "crw" => Some("column-rule-width"), - "column-span" | "csn" => Some("column-span"), - "column-width" | "cw" => Some("column-width"), - "columns" | "cols" => Some("columns"), - "computed" | "cmp" => Some("computed"), - "contain" | "cntn" => Some("contain"), - "contain-intrinsic-block-size" | "cibs" => Some("contain-intrinsic-block-size"), - "contain-intrinsic-height" | "cih" => Some("contain-intrinsic-height"), - "contain-intrinsic-inline-size" | "ciis" => Some("contain-intrinsic-inline-size"), - "contain-intrinsic-size" | "cis" => Some("contain-intrinsic-size"), - "contain-intrinsic-width" | "ciw" => Some("contain-intrinsic-width"), - "container" | "ctr" => Some("container"), - "container-name" | "ctrn" => Some("container-name"), - "container-type" | "ctrt" => Some("container-type"), - "content" | "cnt" => Some("content"), - "content-visibility" | "cntv" => Some("content-visibility"), - "counter-increment" | "cinc" => Some("counter-increment"), - "counter-reset" | "crst" => Some("counter-reset"), - "counter-set" | "cset" => Some("counter-set"), - "cursor" | "cur" => Some("cursor"), - "direction" | "dir" => Some("direction"), - "display" | "d" => Some("display"), - "empty-cells" | "ec" => Some("empty-cells"), - "field-sizing" | "fsz" => Some("field-sizing"), - "filter" | "flt" => Some("filter"), - "flex" | "flx" => Some("flex"), - "flex-basis" | "flxb" => Some("flex-basis"), - "flex-direction" | "flex-dir" => Some("flex-direction"), - "flex-flow" | "flex-fl" => Some("flex-flow"), - "flex-grow" | "flex-gr" => Some("flex-grow"), - "flex-shrink" | "flex-sh" => Some("flex-shrink"), - "flex-wrap" | "flex-wr" => Some("flex-wrap"), - "float" => Some("float"), - "font" | "fnt" => Some("font"), - "font-family" | "ff" => Some("font-family"), - "font-feature-settings" | "ffs" => Some("font-feature-settings"), - "font-kerning" | "fk" => Some("font-kerning"), - "font-language-override" | "flo" => Some("font-language-override"), - "font-optical-sizing" | "fos" => Some("font-optical-sizing"), - "font-palette" | "fp" => Some("font-palette"), - "font-size" | "fs" => Some("font-size"), - "font-size-adjust" | "fsa" => Some("font-size-adjust"), - "font-smooth" | "fsm" => Some("font-smooth"), - "font-stretch" | "fstr" => Some("font-stretch"), - "font-style" | "fsty" => Some("font-style"), - "font-synthesis" | "fsyn" => Some("font-synthesis"), - "font-synthesis-position" | "fsynp" => Some("font-synthesis-position"), - "font-synthesis-small-caps" | "fssc" => Some("font-synthesis-small-caps"), - "font-synthesis-style" | "fss" => Some("font-synthesis-style"), - "font-synthesis-weight" | "fsw" => Some("font-synthesis-weight"), - "font-variant" | "fv" => Some("font-variant"), - "font-variant-alternates" | "fva" => Some("font-variant-alternates"), - "font-variant-caps" | "fvc" => Some("font-variant-caps"), - "font-variant-east-asian" | "fvea" => Some("font-variant-east-asian"), - "font-variant-emoji" | "fve" => Some("font-variant-emoji"), - "font-variant-ligatures" | "fvl" => Some("font-variant-ligatures"), - "font-variant-numeric" | "fvn" => Some("font-variant-numeric"), - "font-variant-position" | "fvp" => Some("font-variant-position"), - "font-variation-settings" | "fvs" => Some("font-variation-settings"), - "font-weight" | "fw" => Some("font-weight"), - "forced-color-adjust" | "fca" => Some("forced-color-adjust"), - "gap" | "g" => Some("gap"), - "grid" | "grd" => Some("grid"), - "grid-area" | "gra" => Some("grid-area"), - "grid-auto-columns" | "grac" => Some("grid-auto-columns"), - "grid-auto-flow" | "graf" => Some("grid-auto-flow"), - "grid-auto-rows" | "grar" => Some("grid-auto-rows"), - "grid-column" | "gc" => Some("grid-column"), - "grid-column-end" | "gce" => Some("grid-column-end"), - "grid-column-gap" | "gcg" => Some("grid-column-gap"), - "grid-column-start" | "gcs" => Some("grid-column-start"), - "grid-gap" | "gg" => Some("grid-gap"), - "grid-row" | "grd-r" => Some("grid-row"), - "grid-row-end" | "gre" => Some("grid-row-end"), - "grid-row-gap" | "grg" => Some("grid-row-gap"), - "grid-row-start" | "grs" => Some("grid-row-start"), - "grid-template" | "gt" => Some("grid-template"), - "grid-template-areas" | "gta" => Some("grid-template-areas"), - "grid-template-columns" | "gtc" => Some("grid-template-columns"), - "grid-template-rows" | "gtr" => Some("grid-template-rows"), - "groups" | "grps" => Some("groups"), - "hanging-punctuation" | "hp" => Some("hanging-punctuation"), - "height" | "h" => Some("height"), - "hyphenate-character" | "hc" => Some("hyphenate-character"), - "hyphenate-limit-chars" | "hlc" => Some("hyphenate-limit-chars"), - "hyphens" | "hy" => Some("hyphens"), - "image-orientation" | "io" => Some("image-orientation"), - "image-rendering" | "imgr" => Some("image-rendering"), - "image-resolution" | "imgres" => Some("image-resolution"), - "ime-mode" | "im" => Some("ime-mode"), - "inherited" | "inh" => Some("inherited"), - "initial" | "init" => Some("initial"), - "initial-letter" | "initl" => Some("initial-letter"), - "initial-letter-align" | "initla" => Some("initial-letter-align"), - "inline-size" | "insz" => Some("inline-size"), - "input-security" | "inps" => Some("input-security"), - "inset" | "in" => Some("inset"), - "inset-area" | "ina" => Some("inset-area"), - "inset-block" | "inb" => Some("inset-block"), - "inset-block-end" | "inbe" => Some("inset-block-end"), - "inset-block-start" | "inbs" => Some("inset-block-start"), - "inset-inline" | "ini" => Some("inset-inline"), - "inset-inline-end" | "inie" => Some("inset-inline-end"), - "inset-inline-start" | "inis" => Some("inset-inline-start"), - "isolation" | "iso" => Some("isolation"), - "justify-content" | "jc" => Some("justify-content"), - "justify-items" | "ji" => Some("justify-items"), - "justify-self" | "js" => Some("justify-self"), - "justify-tracks" | "jt" => Some("justify-tracks"), - "left" | "l" => Some("left"), - "letter-spacing" | "ltrsp" => Some("letter-spacing"), - "line-break" | "lb" => Some("line-break"), - "line-clamp" | "lc" => Some("line-clamp"), - "line-height" | "lh" => Some("line-height"), - "line-height-step" | "lhs" => Some("line-height-step"), - "list-style" | "lstyl" => Some("list-style"), - "list-style-image" | "lsi" => Some("list-style-image"), - "list-style-position" | "lsp" => Some("list-style-position"), - "list-style-type" | "lst" => Some("list-style-type"), - "margin" | "m" => Some("margin"), - "margin-block" | "mblk" => Some("margin-block"), - "margin-block-end" | "mbe" => Some("margin-block-end"), - "margin-block-start" | "mbs" => Some("margin-block-start"), - "margin-bottom" | "mbtm" => Some("margin-bottom"), - "margin-inline" | "mi" => Some("margin-inline"), - "margin-inline-end" | "mie" => Some("margin-inline-end"), - "margin-inline-start" | "mis" => Some("margin-inline-start"), - "margin-left" | "ml" => Some("margin-left"), - "margin-right" | "mr" => Some("margin-right"), - "margin-top" | "mt" => Some("margin-top"), - "margin-trim" | "mtrim" => Some("margin-trim"), - "mask" => Some("mask"), - "mask-border" | "mask-b" => Some("mask-border"), - "mask-border-mode" | "mask-bm" => Some("mask-border-mode"), - "mask-border-outset" | "mask-bo" => Some("mask-border-outset"), - "mask-border-repeat" | "mask-br" => Some("mask-border-repeat"), - "mask-border-slice" | "mask-bs" => Some("mask-border-slice"), - "mask-border-source" | "mask-bsou" => Some("mask-border-source"), - "mask-border-width" | "mask-bw" => Some("mask-border-width"), - "mask-clip" | "mask-c" => Some("mask-clip"), - "mask-composite" | "mask-comp" => Some("mask-composite"), - "mask-image" | "mask-i" => Some("mask-image"), - "mask-mode" | "mask-m" => Some("mask-mode"), - "mask-origin" | "mask-o" => Some("mask-origin"), - "mask-position" | "mask-pos" => Some("mask-position"), - "mask-repeat" | "mask-r" => Some("mask-repeat"), - "mask-size" | "mask-sz" => Some("mask-size"), - "mask-type" | "mask-t" => Some("mask-type"), - "masonry-auto-flow" | "mas-af" => Some("masonry-auto-flow"), - "math-depth" | "math-d" => Some("math-depth"), - "math-shift" | "math-s" => Some("math-shift"), - "math-style" | "math-st" => Some("math-style"), - "max-block-size" | "max-bs" => Some("max-block-size"), - "max-height" | "max-h" => Some("max-height"), - "max-inline-size" | "max-is" => Some("max-inline-size"), - "max-lines" | "max-l" => Some("max-lines"), - "max-width" | "max-w" => Some("max-width"), - "mdn_url" | "mdn-u" => Some("mdn_url"), - "media" | "med" => Some("media"), - "min-block-size" | "min-bs" => Some("min-block-size"), - "min-height" | "min-h" => Some("min-height"), - "min-inline-size" | "min-is" => Some("min-inline-size"), - "min-width" | "min-w" => Some("min-width"), - "mix-blend-mode" | "mbm" => Some("mix-blend-mode"), - "object-fit" | "obj-fit" => Some("object-fit"), - "object-position" | "obj-pos" => Some("object-position"), - "offset" | "off" => Some("offset"), - "offset-anchor" | "ofa" => Some("offset-anchor"), - "offset-distance" | "ofd" => Some("offset-distance"), - "offset-path" | "ofp" => Some("offset-path"), - "offset-position" | "ofpos" => Some("offset-position"), - "offset-rotate" | "ofr" => Some("offset-rotate"), - "opacity" | "op" => Some("opacity"), - "order" | "ord" => Some("order"), - "orphans" | "orphan" => Some("orphans"), - "outline" | "out" => Some("outline"), - "outline-color" | "outc" => Some("outline-color"), - "outline-offset" | "outo" => Some("outline-offset"), - "outline-style" | "outs" => Some("outline-style"), - "outline-width" | "outw" => Some("outline-width"), - "overflow" | "ov" => Some("overflow"), - "overflow-anchor" | "ova" => Some("overflow-anchor"), - "overflow-block" | "ovb" => Some("overflow-block"), - "overflow-clip-box" | "ovcb" => Some("overflow-clip-box"), - "overflow-clip-margin" | "ovcm" => Some("overflow-clip-margin"), - "overflow-inline" | "ovi" => Some("overflow-inline"), - "overflow-wrap" | "ovw" => Some("overflow-wrap"), - "overflow-x" | "ovx" => Some("overflow-x"), - "overflow-y" | "ovy" => Some("overflow-y"), - "overlay" => Some("overlay"), - "overscroll-behavior" | "ovsb" => Some("overscroll-behavior"), - "overscroll-behavior-block" | "ovsb-b" => Some("overscroll-behavior-block"), - "overscroll-behavior-inline" | "ovsb-i" => Some("overscroll-behavior-inline"), - "overscroll-behavior-x" | "ovsbx" => Some("overscroll-behavior-x"), - "overscroll-behavior-y" | "ovsby" => Some("overscroll-behavior-y"), - "padding" | "p" => Some("padding"), - "padding-block" | "pblk" => Some("padding-block"), - "padding-block-end" | "pbe" => Some("padding-block-end"), - "padding-block-start" | "pbs" => Some("padding-block-start"), - "padding-bottom" | "pbtm" => Some("padding-bottom"), - "padding-inline" | "pinl" => Some("padding-inline"), - "padding-inline-end" | "pie" => Some("padding-inline-end"), - "padding-inline-start" | "pis" => Some("padding-inline-start"), - "padding-left" | "pl" => Some("padding-left"), - "padding-right" | "pr" => Some("padding-right"), - "padding-top" | "pt" => Some("padding-top"), - "page" => Some("page"), - "page-break-after" | "pba" => Some("page-break-after"), - "page-break-before" | "pbb" => Some("page-break-before"), - "page-break-inside" | "pbi" => Some("page-break-inside"), - "paint-order" | "po" => Some("paint-order"), - "percentages" | "pct" => Some("percentages"), - "perspective" | "pers" => Some("perspective"), - "perspective-origin" | "pers-or" => Some("perspective-origin"), - "place-content" | "pc" => Some("place-content"), - "place-items" | "plc-it" => Some("place-items"), - "place-self" | "ps" => Some("place-self"), - "pointer-events" | "pe" => Some("pointer-events"), - "position" | "pos" => Some("position"), - "position-anchor" | "pos-anch" => Some("position-anchor"), - "position-try" | "pos-try" => Some("position-try"), - "position-try-options" | "pos-try-opt" => Some("position-try-options"), - "position-try-order" | "pos-try-ord" => Some("position-try-order"), - "position-visibility" | "pos-vis" => Some("position-visibility"), - "print-color-adjust" | "pca" => Some("print-color-adjust"), - "quotes" | "q" => Some("quotes"), - "resize" | "rsz" => Some("resize"), - "right" | "r" => Some("right"), - "rotate" | "rot" => Some("rotate"), - "row-gap" | "rg" => Some("row-gap"), - "ruby-align" | "ra" => Some("ruby-align"), - "ruby-merge" | "rm" => Some("ruby-merge"), - "ruby-position" | "rp" => Some("ruby-position"), - "scale" | "scl" => Some("scale"), - "scroll-behavior" | "sb" => Some("scroll-behavior"), - "scroll-margin" | "scrlm" => Some("scroll-margin"), - "scroll-margin-block" | "smb" => Some("scroll-margin-block"), - "scroll-margin-block-end" | "smbe" => Some("scroll-margin-block-end"), - "scroll-margin-block-start" | "smbs" => Some("scroll-margin-block-start"), - "scroll-margin-bottom" | "smbt" => Some("scroll-margin-bottom"), - "scroll-margin-inline" | "smi" => Some("scroll-margin-inline"), - "scroll-margin-inline-end" | "smie" => Some("scroll-margin-inline-end"), - "scroll-margin-inline-start" | "smis" => Some("scroll-margin-inline-start"), - "scroll-margin-left" | "sml" => Some("scroll-margin-left"), - "scroll-margin-right" | "smr" => Some("scroll-margin-right"), - "scroll-margin-top" | "smt" => Some("scroll-margin-top"), - "scroll-padding" | "sp" => Some("scroll-padding"), - "scroll-padding-block" | "spb" => Some("scroll-padding-block"), - "scroll-padding-block-end" | "spbe" => Some("scroll-padding-block-end"), - "scroll-padding-block-start" | "spbs" => Some("scroll-padding-block-start"), - "scroll-padding-bottom" | "spbot" => Some("scroll-padding-bottom"), - "scroll-padding-inline" | "spi" => Some("scroll-padding-inline"), - "scroll-padding-inline-end" | "spie" => Some("scroll-padding-inline-end"), - "scroll-padding-inline-start" | "spis" => Some("scroll-padding-inline-start"), - "scroll-padding-left" | "spl" => Some("scroll-padding-left"), - "scroll-padding-right" | "spr" => Some("scroll-padding-right"), - "scroll-padding-top" | "spt" => Some("scroll-padding-top"), - "scroll-snap-align" | "ssa" => Some("scroll-snap-align"), - "scroll-snap-coordinate" | "ssc" => Some("scroll-snap-coordinate"), - "scroll-snap-destination" | "ssd" => Some("scroll-snap-destination"), - "scroll-snap-points-x" | "sspx" => Some("scroll-snap-points-x"), - "scroll-snap-points-y" | "sspy" => Some("scroll-snap-points-y"), - "scroll-snap-stop" | "sss" => Some("scroll-snap-stop"), - "scroll-snap-type" | "sst" => Some("scroll-snap-type"), - "scroll-snap-type-x" | "sstx" => Some("scroll-snap-type-x"), - "scroll-snap-type-y" | "ssty" => Some("scroll-snap-type-y"), - "scroll-timeline" | "stl" => Some("scroll-timeline"), - "scroll-timeline-axis" | "sta" => Some("scroll-timeline-axis"), - "scroll-timeline-name" | "stn" => Some("scroll-timeline-name"), - "scrollbar-color" | "scrlbc" => Some("scrollbar-color"), - "scrollbar-gutter" | "sg" => Some("scrollbar-gutter"), - "scrollbar-width" | "sw" => Some("scrollbar-width"), - "shape-image-threshold" | "sit" => Some("shape-image-threshold"), - "shape-margin" | "shpm" => Some("shape-margin"), - "shape-outside" | "so" => Some("shape-outside"), - "stacking" | "stk" => Some("stacking"), - "status" | "sts" => Some("status"), - "syntax" | "syn" => Some("syntax"), - "tab-size" | "ts" => Some("tab-size"), - "table-layout" | "tbllyt" => Some("table-layout"), - "text-align" | "ta" => Some("text-align"), - "text-align-last" | "tal" => Some("text-align-last"), - "text-combine-upright" | "tcu" => Some("text-combine-upright"), - "text-decoration" | "td" => Some("text-decoration"), - "text-decoration-color" | "tdc" => Some("text-decoration-color"), - "text-decoration-line" | "tdl" => Some("text-decoration-line"), - "text-decoration-skip" | "tds" => Some("text-decoration-skip"), - "text-decoration-skip-ink" | "tdsi" => Some("text-decoration-skip-ink"), - "text-decoration-style" | "tdst" => Some("text-decoration-style"), - "text-decoration-thickness" | "tdth" => Some("text-decoration-thickness"), - "text-emphasis" | "te" => Some("text-emphasis"), - "text-emphasis-color" | "tec" => Some("text-emphasis-color"), - "text-emphasis-position" | "tep" => Some("text-emphasis-position"), - "text-emphasis-style" | "tes" => Some("text-emphasis-style"), - "text-indent" | "ti" => Some("text-indent"), - "text-justify" | "tj" => Some("text-justify"), - "text-orientation" | "to" => Some("text-orientation"), - "text-overflow" | "tov" => Some("text-overflow"), - "text-rendering" | "txtrnd" => Some("text-rendering"), - "text-shadow" | "tsh" => Some("text-shadow"), - "text-size-adjust" | "tsa" => Some("text-size-adjust"), - "text-spacing-trim" | "tst" => Some("text-spacing-trim"), - "text-transform" | "tt" => Some("text-transform"), - "text-underline-offset" | "tuo" => Some("text-underline-offset"), - "text-underline-position" | "tup" => Some("text-underline-position"), - "text-wrap" | "tw" => Some("text-wrap"), - "text-wrap-mode" | "twm" => Some("text-wrap-mode"), - "text-wrap-style" | "tws" => Some("text-wrap-style"), - "timeline-scope" | "tls" => Some("timeline-scope"), - "top" | "t" => Some("top"), - "touch-action" | "tchact" => Some("touch-action"), - "transform" | "tf" => Some("transform"), - "transform-box" | "tfb" => Some("transform-box"), - "transform-origin" | "tfo" => Some("transform-origin"), - "transform-style" | "tfs" => Some("transform-style"), - "transition" | "trans" => Some("transition"), - "transition-behavior" | "trb" => Some("transition-behavior"), - "transition-delay" | "trd" => Some("transition-delay"), - "transition-duration" | "trdu" => Some("transition-duration"), - "transition-property" | "trp" => Some("transition-property"), - "transition-timing-function" | "trtf" => Some("transition-timing-function"), - "translate" | "transl" => Some("translate"), - "unicode-bidi" | "ub" => Some("unicode-bidi"), - "user-select" | "us" => Some("user-select"), - "vertical-align" | "va" => Some("vertical-align"), - "view-timeline" | "vt" => Some("view-timeline"), - "view-timeline-axis" | "vta" => Some("view-timeline-axis"), - "view-timeline-inset" | "vti" => Some("view-timeline-inset"), - "view-timeline-name" | "vtn" => Some("view-timeline-name"), - "view-transition-name" | "vtrn" => Some("view-transition-name"), - "visibility" | "vis" => Some("visibility"), - "white-space" | "ws" => Some("white-space"), - "white-space-collapse" | "wsc" => Some("white-space-collapse"), - "widows" | "wdw" => Some("widows"), - "width" | "w" => Some("width"), - "will-change" | "wc" => Some("will-change"), - "word-break" | "wb" => Some("word-break"), - "word-spacing" | "wsp" => Some("word-spacing"), - "word-wrap" | "ww" => Some("word-wrap"), - "writing-mode" | "wm" => Some("writing-mode"), - "z-index" | "z" => Some("z-index"), - "zoom" | "zm" => Some("zoom"), - // --- CUSTOM --- - // generate built-in animation with all predefined rules - "g-anim" => Some("g-anim"), - - _ => None, - } + get_css_property(component_str) }; match css_property { diff --git a/src/core/mod.rs b/src/core/mod.rs index 5583246..80736bc 100644 --- a/src/core/mod.rs +++ b/src/core/mod.rs @@ -7,6 +7,7 @@ mod animations; mod build_info; +pub mod component; pub mod config; pub mod css_builder; mod css_generator; diff --git a/src/core/parser.rs b/src/core/parser.rs index 503803b..a14e503 100644 --- a/src/core/parser.rs +++ b/src/core/parser.rs @@ -2,18 +2,15 @@ //! and templated spells from HTML or other input files. It can traverse directories, parse files, //! and extract class names based on specific patterns, using regular expressions. +use super::GrimoireCSSError; +use crate::buffer::add_message; +use regex::Regex; use std::{ collections::HashSet, fs, path::{Path, PathBuf}, }; -use regex::Regex; - -use crate::buffer::add_message; - -use super::GrimoireCSSError; - /// `Parser` is responsible for extracting CSS class names and templated spells from HTML or other /// files. It uses regular expressions to find class names and spell-like patterns, and supports /// processing both single files and entire directories.