1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! This module defines the core data structures used throughout the library
//! for representing BEM (Block Element Modifier) components. These structures
//! are used for both parsing and serializing BEM notation.
use ;
/// Represents a BEM (Block Element Modifier) block, which consists of a name,
/// a list of modifiers, and a list of elements.
///
/// A BEM block is the top-level abstraction in BEM, and it can have zero or more
/// elements and modifiers associated with it.
///
/// # Example
///
/// ```
/// use bem::BEMBlock;
///
/// let block = BEMBlock {
/// name: "media-player".to_string(),
/// modifiers: vec!["dark".to_string()],
/// elements: vec![/* BEMElement structs go here */],
/// };
/// ```
/// Represents an element within a BEM block, with its own name and list of modifiers.
///
/// A BEM element is a component part of a BEM block, and it can have zero or more
/// modifiers associated with it.
///
/// # Example
///
/// ```
/// use bem::BEMElement;
///
/// let element = BEMElement {
/// name: "button".to_string(),
/// modifiers: vec!["fast-forward".to_string(), "rewind".to_string()],
/// };
/// ```