extract_variables_from_css() — tailwindcss Function Reference
Architecture documentation for the extract_variables_from_css() function in mod.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD 3e9160fa_9f87_0a7b_ddb8_0c888115286d["extract_variables_from_css()"] 435a321a_a1e2_cb4f_7579_0ca15cb86434["advance()"] 3e9160fa_9f87_0a7b_ddb8_0c888115286d -->|calls| 435a321a_a1e2_cb4f_7579_0ca15cb86434 5a97c1ff_d6d8_407b_cdd5_f7b3455d1d2c["slice()"] 3e9160fa_9f87_0a7b_ddb8_0c888115286d -->|calls| 5a97c1ff_d6d8_407b_cdd5_f7b3455d1d2c style 3e9160fa_9f87_0a7b_ddb8_0c888115286d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/oxide/src/extractor/mod.rs lines 143–176
pub fn extract_variables_from_css(&mut self) -> Vec<Extracted<'a>> {
let mut extracted = Vec::with_capacity(100);
let len = self.cursor.input.len();
let cursor = &mut self.cursor.clone();
while cursor.pos < len {
if cursor.curr.is_ascii_whitespace() {
cursor.advance();
continue;
}
if let MachineState::Done(span) = self.css_variable_machine.next(cursor) {
// We are only interested in variables that are used, not defined. Therefore we
// need to ensure that the variable is prefixed with `var(`.
if span.start < 4 {
cursor.advance();
continue;
}
let slice_before = Span::new(span.start - 4, span.start - 1);
if !slice_before.slice(self.cursor.input).starts_with(b"var(") {
cursor.advance();
continue;
}
extracted.push(Extracted::CssVariable(span.slice(self.cursor.input)));
}
cursor.advance();
}
extracted
}
Domain
Subdomains
Source
Frequently Asked Questions
What does extract_variables_from_css() do?
extract_variables_from_css() is a function in the tailwindcss codebase.
What does extract_variables_from_css() call?
extract_variables_from_css() calls 2 function(s): advance, slice.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free