css_ast/functions/
calc_size_function.rs

1use super::prelude::*;
2
3/// <https://drafts.csswg.org/css-values-5/#calc-size>
4///
5/// ```text,ignore
6/// <calc-size()> = calc-size( <calc-size-basis>, <calc-sum> )
7/// <calc-size-basis> = [ <size-keyword> | <calc-size()> | any | <calc-sum> ]
8/// ```
9///
10/// The `<size-keyword>` production matches any sizing keywords allowed in the context.
11/// For example, in width, it matches auto, min-content, stretch, etc.
12#[derive(Parse, Peek, ToCursors, ToSpan, SemanticEq, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13#[cfg_attr(feature = "serde", derive(serde::Serialize), serde())]
14#[cfg_attr(feature = "visitable", derive(csskit_derives::Visitable), visit(self))]
15#[derive(csskit_derives::NodeWithMetadata)]
16pub struct CalcSizeFunction {
17	#[atom(CssAtomSet::CalcSize)]
18	pub name: T![Function],
19	pub params: Todo,
20	pub close: T![')'],
21}
22
23#[cfg(test)]
24mod tests {
25	use super::*;
26
27	#[test]
28	fn size_test() {
29		assert_eq!(std::mem::size_of::<CalcSizeFunction>(), 24);
30	}
31}