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