basecoat_core/classes/textarea.rs
1use crate::props::textarea::TextareaProps;
2
3/// Returns the canonical CSS class string for a textarea.
4///
5/// Upstream: single `.textarea` class.
6pub fn textarea(p: &TextareaProps) -> String {
7 match &p.class {
8 Some(extra) if !extra.is_empty() => format!("textarea {extra}"),
9 _ => "textarea".to_string(),
10 }
11}
12
13#[cfg(test)]
14mod tests {
15 use super::*;
16 use crate::props::textarea::TextareaProps;
17
18 #[test]
19 fn base_class() {
20 assert_eq!(textarea(&TextareaProps::default()), "textarea");
21 }
22}