1pub use self::modifiers::*;
2
3mod modifiers;
4
5#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
7pub struct RetrievedClassDefinition {
8 pub class_name: String,
10 pub css_class_definition: String,
12 pub modifiers: Modifiers,
14}
15
16impl RetrievedClassDefinition {
17 pub fn new(class_name: String, css_class_definition: String, modifiers: Modifiers) -> Self {
19 RetrievedClassDefinition {
20 class_name,
21 css_class_definition,
22 modifiers,
23 }
24 }
25}
26
27#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Copy, Clone)]
29pub enum PixelsOrPercent {
30 Pixels(u32),
32 Percentage(Percent),
34}
35
36#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Copy, Clone)]
38pub struct Percent(u8);
39
40impl Percent {
41 pub(crate) fn new(percentage: u32) -> Option<Percent> {
42 if percentage <= 100 {
43 Some(Percent(percentage as u8))
44 } else {
45 None
46 }
47 }
48
49 pub(crate) fn get(&self) -> u8 {
50 self.0
51 }
52}