peacock_crest/style/prop_validation/
padding.rs1use super::{CssValue, TokenExpected};
2use crate::Unit;
3
4#[derive(Debug, Clone)]
5pub struct CssPadding(Unit);
6
7impl From<Unit> for CssPadding {
8 fn from(value: Unit) -> Self {
9 Self(value)
10 }
11}
12
13impl Into<Unit> for CssPadding {
14 fn into(self) -> Unit {
15 self.0
16 }
17}
18
19impl CssValue for CssPadding {
20 type Keyword = super::KeywordNone;
21
22 fn type_name() -> &'static str {
23 "CssPadding"
24 }
25
26 fn type_token() -> TokenExpected {
27 TokenExpected::Dimension | TokenExpected::Number
28 }
29}