Skip to main content

dioxus_element_plug/styles/
utilities.rs

1//! # Utility Classes
2//!
3//! Utility classes and helper functions for Element Plus styling.
4
5/// Generate responsive grid classes
6pub fn generate_grid_classes() -> String {
7    let mut grid_css = String::new();
8    
9    grid_css.push_str(r#"
10/* Row */
11.el-row {
12    display: flex;
13    flex-wrap: wrap;
14    position: relative;
15}
16
17/* Column system */
18.el-col-1 { width: 4.1666666667%; }
19.el-col-2 { width: 8.3333333333%; }
20.el-col-3 { width: 12.5%; }
21.el-col-4 { width: 16.6666666667%; }
22.el-col-5 { width: 20.8333333333%; }
23.el-col-6 { width: 25%; }
24.el-col-7 { width: 29.1666666667%; }
25.el-col-8 { width: 33.3333333333%; }
26.el-col-9 { width: 37.5%; }
27.el-col-10 { width: 41.6666666667%; }
28.el-col-11 { width: 45.8333333333%; }
29.el-col-12 { width: 50%; }
30.el-col-13 { width: 54.1666666667%; }
31.el-col-14 { width: 58.3333333333%; }
32.el-col-15 { width: 62.5%; }
33.el-col-16 { width: 66.6666666667%; }
34.el-col-17 { width: 70.8333333333%; }
35.el-col-18 { width: 75%; }
36.el-col-19 { width: 79.1666666667%; }
37.el-col-20 { width: 83.3333333333%; }
38.el-col-21 { width: 87.5%; }
39.el-col-22 { width: 91.6666666667%; }
40.el-col-23 { width: 95.8333333333%; }
41.el-col-24 { width: 100%; }
42"#);
43    
44    grid_css
45}
46
47/// Generate display utility classes
48pub fn generate_display_utilities() -> String {
49    String::from(r#"
50/* Display utilities */
51.d-none { display: none; }
52.d-block { display: block; }
53.d-inline { display: inline; }
54.d-inline-block { display: inline-block; }
55.d-flex { display: flex; }
56.d-inline-flex { display: inline-flex; }
57"#)
58}