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))]
15pub struct CalcSizeFunction {
16	#[atom(CssAtomSet::CalcSize)]
17	pub name: T![Function],
18	pub params: Todo,
19	pub close: T![')'],
20}
21
22#[cfg(test)]
23mod tests {
24	use super::*;
25
26	#[test]
27	fn size_test() {
28		assert_eq!(std::mem::size_of::<CalcSizeFunction>(), 24);
29	}
30}