dioxus_element_plug/styles/
enhanced_css_system.rs1pub fn all_styles() -> String {
6 let mut css = String::new();
7
8 css.push_str(create_css_reset().as_str());
10 css.push_str("\n\n");
11
12 css.push_str(create_theme_variables().as_str());
14 css.push_str("\n\n");
15
16 css.push_str(generate_all_component_styles().as_str());
18
19 css
20}
21
22fn create_css_reset() -> String {
23 r#"/* Element Plus CSS Reset */
24*, *::before, *::after {
25 box-sizing: border-box;
26}
27
28html {
29 font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
30 font-size: 14px;
31 line-height: 1.42857143;
32 color: #606266;
33 background-color: #fff;
34}
35
36/* Normalize component display */
37.el-component {
38 position: relative;
39 margin: 0;
40 padding: 0;
41 border: 0;
42 outline: 0;
43 vertical-align: baseline;
44}
45
46/* Utility classes */
47.el-hidden {
48 display: none !important;
49}
50
51.el-invisible {
52 visibility: hidden !important;
53}
54
55.el-clearfix::after {
56 content: "";
57 display: block;
58 clear: both;
59}
60
61/* Animation utilities */
62.el-transition {
63 transition: all .3s cubic-bezier(.645,.045,.355,1);
64}
65
66/* Cursor utilities */
67.el-cursor-pointer {
68 cursor: pointer;
69}
70
71.el-cursor-not-allowed {
72 cursor: not-allowed;
73}
74"#.to_string()
75}
76
77fn create_theme_variables() -> String {
78 r#"/* Element Plus Theme Variables */
79:root {
80 /* Primary colors */
81 --el-color-primary: #409eff;
82 --el-color-primary-light-3: #79bbff;
83 --el-color-primary-light-5: #a0cfff;
84 --el-color-primary-light-7: #c6e2ff;
85 --el-color-primary-light-8: #d9ecff;
86 --el-color-primary-light-9: #ecf5ff;
87 --el-color-primary-dark-2: #337ecc;
88
89 /* Success colors */
90 --el-color-success: #67c23a;
91 --el-color-success-light-3: #95d475;
92 --el-color-success-light-5: #b3e19d;
93 --el-color-success-light-7: #d1edc4;
94 --el-color-success-light-8: #e1f3d8;
95 --el-color-success-light-9: #f0f9ff;
96 --el-color-success-dark-2: #529b2e;
97
98 /* Warning colors */
99 --el-color-warning: #e6a23c;
100 --el-color-warning-light-3: #eebe77;
101 --el-color-warning-light-5: #f3d19e;
102 --el-color-warning-light-7: #f8e3c5;
103 --el-color-warning-light-8: #faecd8;
104 --el-color-warning-light-9: #fdf6ec;
105 --el-color-warning-dark-2: #b8860b;
106
107 /* Danger colors */
108 --el-color-danger: #f56c6c;
109 --el-color-danger-light-3: #f89898;
110 --el-color-danger-light-5: #fab6b6;
111 --el-color-danger-light-7: #fcd3d3;
112 --el-color-danger-light-8: #fde2e2;
113 --el-color-danger-light-9: #fef0f0;
114 --el-color-danger-dark-2: #c45656;
115
116 /* Info colors */
117 --el-color-info: #909399;
118 --el-color-info-light-3: #b1b3b8;
119 --el-color-info-light-5: #c8c9cc;
120 --el-color-info-light-7: #dcddde;
121 --el-color-info-light-8: #e6e8ea;
122 --el-color-info-light-9: #f4f4f5;
123 --el-color-info-dark-2: #73767a;
124
125 /* Base colors */
126 --el-color-white: #ffffff;
127 --el-color-black: #000000;
128 --el-text-color: #606266;
129 --el-text-color-regular: #606266;
130 --el-text-color-primary: #303133;
131 --el-text-color-secondary: #909399;
132 --el-text-color-placeholder: #a8abb2;
133
134 /* Border */
135 --el-border-width: 1px;
136 --el-border-style: solid;
137 --el-border-color-hover: #c0c4cc;
138 --el-border-base: var(--el-border-width) var(--el-border-style) #dcdfe6;
139 --el-border-radius-base: 4px;
140 --el-border-radius-small: 2px;
141 --el-border-radius-round: 20px;
142 --el-border-radius-circle: 100%;
143
144 /* Font */
145 --el-font-size-extra-large: 20px;
146 --el-font-size-large: 18px;
147 --el-font-size-medium: 16px;
148 --el-font-size-base: 14px;
149 --el-font-size-small: 13px;
150 --el-font-size-extra-small: 12px;
151
152 /* Background */
153 --el-bg-color: #ffffff;
154 --el-bg-color-overlay: #ffffff;
155 --el-bg-color-page: #f2f3f5;
156 --el-bg-color: #ffffff;
157
158 /* Transitions */
159 --el-transition-duration: .3s;
160 --el-transition-duration-fast: .2s;
161 --el-transition-function-ease-in-out-bezier: cubic-bezier(.645,.045,.355,1);
162 --el-transition-function-fast-bezier: cubic-bezier(.23,1,.32,1);
163 --el-transition-all: all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);
164 --el-transition-fade: opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);
165 --el-transition-md-fade: transform var(--el-transition-duration) var(--el-transition-function-fast-bezier), opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);
166 --el-transition-fade-linear: opacity var(--el-transition-duration-fast) linear;
167 --el-transition-border: border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);
168 --el-transition-box-shadow: box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);
169 --el-transition-color: color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);
170}
171"#.to_string()
172}
173
174fn generate_all_component_styles() -> String {
175 let mut css = String::new();
176
177 css.push_str(generate_button_styles().as_str());
179 css.push_str("\n\n");
180
181 css.push_str(generate_input_styles().as_str());
183 css.push_str("\n\n");
184
185 css.push_str(generate_form_styles().as_str());
187 css.push_str("\n\n");
188
189 css.push_str(generate_layout_styles().as_str());
191 css.push_str("\n\n");
192
193 css.push_str(generate_data_display_styles().as_str());
195 css.push_str("\n\n");
196
197 css.push_str(generate_feedback_styles().as_str());
199 css.push_str("\n\n");
200
201 css.push_str(generate_navigation_styles().as_str());
203 css.push_str("\n\n");
204
205 css.push_str(generate_additional_styles().as_str());
207
208 css
209}
210
211fn generate_button_styles() -> String {
212 r#"/* Button Component Styles */
213.el-button {
214 display: inline-block;
215 line-height: 1;
216 white-space: nowrap;
217 cursor: pointer;
218 background: var(--el-color-white);
219 border: var(--el-border-base);
220 border-color: #dcdfe6;
221 color: var(--el-text-color-regular);
222 text-align: center;
223 box-sizing: border-box;
224 outline: none;
225 margin: 0;
226 transition: var(--el-transition-duration);
227 font-weight: 500;
228 user-select: none;
229 padding: 12px 20px;
230 font-size: var(--el-font-size-base);
231 border-radius: var(--el-border-radius-base);
232}
233
234.el-button:hover,
235.el-button:focus {
236 color: var(--el-color-primary);
237 border-color: var(--el-color-primary-light-7);
238 background-color: var(--el-color-primary-light-9);
239}
240
241.el-button:active {
242 color: var(--el-color-primary-dark-2);
243 border-color: var(--el-color-primary-dark-2);
244 outline: none;
245}
246
247.el-button.is-disabled,
248.el-button.is-disabled:hover,
249.el-button.is-disabled:focus {
250 color: var(--el-text-color-placeholder);
251 cursor: not-allowed;
252 background-image: none;
253 background-color: var(--el-color-white);
254 border-color: #e4e7ed;
255}
256
257/* Button type variants */
258.el-button--primary {
259 color: var(--el-color-white);
260 background-color: var(--el-color-primary);
261 border-color: var(--el-color-primary);
262}
263
264.el-button--primary:hover,
265.el-button--primary:focus {
266 background: var(--el-color-primary-light-3);
267 border-color: var(--el-color-primary-light-3);
268 color: var(--el-color-white);
269}
270
271.el-button--success {
272 color: var(--el-color-white);
273 background-color: var(--el-color-success);
274 border-color: var(--el-color-success);
275}
276
277.el-button--success:hover,
278.el-button--success:focus {
279 background: var(--el-color-success-light-3);
280 border-color: var(--el-color-success-light-3);
281 color: var(--el-color-white);
282}
283
284.el-button--warning {
285 color: var(--el-color-white);
286 background-color: var(--el-color-warning);
287 border-color: var(--el-color-warning);
288}
289
290.el-button--warning:hover,
291.el-button--warning:focus {
292 background: var(--el-color-warning-light-3);
293 border-color: var(--el-color-warning-light-3);
294 color: var(--el-color-white);
295}
296
297.el-button--danger {
298 color: var(--el-color-white);
299 background-color: var(--el-color-danger);
300 border-color: var(--el-color-danger);
301}
302
303.el-button--danger:hover,
304.el-button--danger:focus {
305 background: var(--el-color-danger-light-3);
306 border-color: var(--el-color-danger-light-3);
307 color: var(--el-color-white);
308}
309
310.el-button--info {
311 color: var(--el-color-white);
312 background-color: var(--el-color-info);
313 border-color: var(--el-color-info);
314}
315
316.el-button--info:hover,
317.el-button--info:focus {
318 background: var(--el-color-info-light-3);
319 border-color: var(--el-color-info-light-3);
320 color: var(--el-color-white);
321}
322
323/* Button size variants */
324.el-button--large {
325 padding: 13px 20px;
326 font-size: var(--el-font-size-medium);
327}
328
329.el-button--small {
330 padding: 9px 15px;
331 font-size: var(--el-font-size-extra-small);
332}
333"#.to_string()
334}
335
336fn generate_input_styles() -> String {
337 r#"/* Input Component Styles */
338.el-input {
339 position: relative;
340 font-size: var(--el-font-size-base);
341 display: inline-block;
342 width: 100%;
343}
344
345.el-input__wrapper {
346 display: inline-flex;
347 flex-grow: 1;
348 align-items: center;
349 justify-content: center;
350 padding: 1px 11px;
351 background-color: var(--el-bg-color);
352 background-image: none;
353 border-radius: var(--el-border-radius-base);
354 cursor: text;
355 transition: var(--el-transition-border);
356 transform: translateZ(0);
357 box-shadow: 0 0 0 1px #dcdfe6 inset;
358}
359
360.el-input__inner {
361 width: 100%;
362 flex-grow: 1;
363 -webkit-appearance: none;
364 color: var(--el-text-color-regular);
365 font-size: inherit;
366 height: 32px;
367 line-height: 32px;
368 padding: 0;
369 outline: none;
370 border: none;
371 background: none;
372 box-sizing: border-box;
373}
374
375.el-input__inner::placeholder {
376 color: var(--el-text-color-placeholder);
377}
378
379.el-input__wrapper:hover {
380 box-shadow: 0 0 0 1px var(--el-border-color-hover) inset;
381}
382
383.el-input__wrapper.is-focus {
384 box-shadow: 0 0 0 1px var(--el-color-primary) inset !important;
385}
386
387.el-input.is-disabled .el-input__wrapper {
388 background-color: #f5f7fa;
389 border-color: #e4e7ed;
390 color: var(--el-text-color-placeholder);
391 cursor: not-allowed;
392}
393
394.el-input--large .el-input__inner {
395 height: 40px;
396 line-height: 40px;
397 font-size: var(--el-font-size-medium);
398}
399
400.el-input--small .el-input__inner {
401 height: 24px;
402 line-height: 24px;
403 font-size: var(--el-font-size-extra-small);
404}
405"#.to_string()
406}
407
408fn generate_form_styles() -> String {
409 r#"/* Form Component Styles */
410.el-form {
411 margin: 0;
412 padding: 0;
413 box-sizing: border-box;
414}
415
416.el-form-item {
417 margin-bottom: 22px;
418 display: flex;
419 flex-direction: column;
420}
421
422.el-form-item__label {
423 text-align: right;
424 vertical-align: middle;
425 float: left;
426 font-size: var(--el-font-size-base);
427 color: var(--el-text-color-regular);
428 line-height: 40px;
429 padding: 0 12px 0 0;
430 box-sizing: border-box;
431}
432
433.el-form-item__content {
434 line-height: 40px;
435 position: relative;
436 font-size: var(--el-font-size-base);
437 flex: 1;
438 display: flex;
439 flex-wrap: wrap;
440 align-items: center;
441}
442
443.el-form-item.is-required > .el-form-item__label:before {
444 content: '*';
445 color: var(--el-color-danger);
446 margin-right: 4px;
447}
448
449.el-form-item.is-error .el-input__wrapper {
450 box-shadow: 0 0 0 1px var(--el-color-danger) inset;
451}
452
453.el-form-item__error {
454 color: var(--el-color-danger);
455 font-size: var(--el-font-size-extra-small);
456 line-height: 1;
457 padding-top: 4px;
458 position: absolute;
459 top: 100%;
460 left: 0;
461}
462"#.to_string()
463}
464
465fn generate_layout_styles() -> String {
466 r#"/* Layout Component Styles */
467.el-container {
468 display: flex;
469 flex-direction: column;
470 flex: 1;
471 flex-basis: auto;
472 box-sizing: border-box;
473 min-width: 0;
474}
475
476.el-header {
477 padding: 0 20px;
478 box-sizing: border-box;
479 flex-shrink: 0;
480 height: 60px;
481 background-color: var(--el-color-white);
482}
483
484.el-aside {
485 overflow: auto;
486 box-sizing: border-box;
487 flex-shrink: 0;
488 width: 200px;
489}
490
491.el-main {
492 flex: 1;
493 flex-basis: auto;
494 overflow: auto;
495 box-sizing: border-box;
496 padding: 20px;
497}
498
499.el-footer {
500 padding: 0 20px;
501 box-sizing: border-box;
502 flex-shrink: 0;
503 height: 60px;
504 background-color: var(--el-color-white);
505}
506
507.el-row {
508 display: flex;
509 flex-wrap: wrap;
510 position: relative;
511 box-sizing: border-box;
512}
513
514.el-col {
515 position: relative;
516 max-width: 100%;
517 min-height: 1px;
518}
519
520/* Grid system */
521.el-col-1 { width: 4.1666666667%; }
522.el-col-2 { width: 8.3333333333%; }
523.el-col-3 { width: 12.5%; }
524.el-col-4 { width: 16.6666666667%; }
525.el-col-5 { width: 20.8333333333%; }
526.el-col-6 { width: 25%; }
527.el-col-7 { width: 29.1666666667%; }
528.el-col-8 { width: 33.3333333333%; }
529.el-col-9 { width: 37.5%; }
530.el-col-10 { width: 41.6666666667%; }
531.el-col-11 { width: 45.8333333333%; }
532.el-col-12 { width: 50%; }
533.el-col-13 { width: 54.1666666667%; }
534.el-col-14 { width: 58.3333333333%; }
535.el-col-15 { width: 62.5%; }
536.el-col-16 { width: 66.6666666667%; }
537.el-col-17 { width: 70.8333333333%; }
538.el-col-18 { width: 75%; }
539.el-col-19 { width: 79.1666666667%; }
540.el-col-20 { width: 83.3333333333%; }
541.el-col-21 { width: 87.5%; }
542.el-col-22 { width: 91.6666666667%; }
543.el-col-23 { width: 95.8333333333%; }
544.el-col-24 { width: 100%; }
545"#.to_string()
546}
547
548fn generate_data_display_styles() -> String {
549 r#"/* Data Display Component Styles */
550
551/* Table */
552.el-table {
553 position: relative;
554 overflow: hidden;
555 box-sizing: border-box;
556 height: fit-content;
557 width: 100%;
558 max-width: 100%;
559 background-color: var(--el-bg-color);
560 font-size: var(--el-font-size-base);
561 color: var(--el-text-color);
562 border: 1px solid #ebeef5;
563}
564
565.el-table th {
566 white-space: nowrap;
567 overflow: hidden;
568 user-select: none;
569 text-align: left;
570 background-color: #fafafa;
571 padding: 12px 0;
572 min-width: 0;
573 box-sizing: border-box;
574 border-bottom: 1px solid #ebeef5;
575}
576
577.el-table td {
578 padding: 12px 0;
579 min-width: 0;
580 box-sizing: border-box;
581 text-overflow: ellipsis;
582 vertical-align: middle;
583 position: relative;
584 border-bottom: 1px solid #ebeef5;
585}
586
587.el-table__row:hover {
588 background-color: #f5f7fa;
589}
590
591/* Card */
592.el-card {
593 border-radius: var(--el-border-radius-base);
594 border: 1px solid #ebeef5;
595 background-color: var(--el-bg-color);
596 overflow: hidden;
597 color: var(--el-text-color-primary);
598 transition: var(--el-transition-duration);
599}
600
601.el-card.is-always-shadow,
602.el-card.is-hover-shadow:focus,
603.el-card.is-hover-shadow:hover {
604 box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
605}
606
607.el-card__header {
608 padding: 18px 20px;
609 border-bottom: 1px solid #ebeef5;
610 box-sizing: border-box;
611}
612
613.el-card__body {
614 padding: 20px;
615}
616
617/* Descriptions */
618.el-descriptions {
619 box-sizing: border-box;
620 font-size: var(--el-font-size-base);
621 color: var(--el-text-color-primary);
622}
623
624.el-descriptions__header {
625 display: flex;
626 justify-content: space-between;
627 align-items: center;
628 margin-bottom: 20px;
629}
630
631.el-descriptions__title {
632 font-size: var(--el-font-size-medium);
633 font-weight: 600;
634 color: var(--el-text-color-primary);
635}
636
637/* Timeline */
638.el-timeline {
639 margin: 0;
640 font-size: var(--el-font-size-base);
641 list-style: none;
642}
643
644.el-timeline-item {
645 position: relative;
646 padding-bottom: 20px;
647}
648
649.el-timeline-item__timestamp {
650 color: var(--el-text-color-secondary);
651 line-height: 1;
652 font-size: var(--el-font-size-extra-small);
653}
654"#.to_string()
655}
656
657fn generate_feedback_styles() -> String {
658 r#"/* Feedback Component Styles */
659
660/* Alert */
661.el-alert {
662 width: 100%;
663 padding: 8px 16px;
664 margin: 0;
665 box-sizing: border-box;
666 border-radius: var(--el-border-radius-base);
667 position: relative;
668 background-color: var(--el-bg-color);
669 overflow: hidden;
670 opacity: 1;
671 display: flex;
672 align-items: center;
673 transition: opacity var(--el-transition-duration);
674}
675
676.el-alert--success {
677 background-color: var(--el-color-success-light-9);
678 border: 1px solid var(--el-color-success-light-5);
679 color: var(--el-color-success);
680}
681
682.el-alert--info {
683 background-color: var(--el-color-info-light-9);
684 border: 1px solid var(--el-color-info-light-5);
685 color: var(--el-color-info);
686}
687
688.el-alert--warning {
689 background-color: var(--el-color-warning-light-9);
690 border: 1px solid var(--el-color-warning-light-5);
691 color: var(--el-color-warning);
692}
693
694.el-alert--error {
695 background-color: var(--el-color-danger-light-9);
696 border: 1px solid var(--el-color-danger-light-5);
697 color: var(--el-color-danger);
698}
699
700/* Message */
701.el-message {
702 min-width: 380px;
703 box-sizing: border-box;
704 border-radius: var(--el-border-radius-base);
705 border: 1px solid #ebeef5;
706 position: fixed;
707 left: 50%;
708 top: 20px;
709 transform: translateX(-50%);
710 background-color: #edf2fc;
711 transition: opacity .3s, transform .4s, top .4s;
712 overflow: hidden;
713 padding: 15px 15px 15px 20px;
714 display: flex;
715 align-items: center;
716}
717
718.el-message--success {
719 background-color: var(--el-color-success-light-9);
720 border-color: var(--el-color-success-light-5);
721}
722
723.el-message--warning {
724 background-color: var(--el-color-warning-light-9);
725 border-color: var(--el-color-warning-light-5);
726}
727
728.el-message--error {
729 background-color: var(--el-color-danger-light-9);
730 border-color: var(--el-color-danger-light-5);
731}
732
733/* Dialog */
734.el-dialog {
735 position: relative;
736 margin: 0 auto 50px;
737 background: var(--el-bg-color);
738 border-radius: var(--el-border-radius-small);
739 box-shadow: 0 1px 3px rgba(0,0,0,.3);
740 box-sizing: border-box;
741 width: 50%;
742 max-width: 90%;
743}
744
745.el-dialog__header {
746 padding: 20px;
747 padding-bottom: 10px;
748}
749
750.el-dialog__title {
751 line-height: 24px;
752 font-size: var(--el-font-size-large);
753 color: var(--el-text-color-primary);
754}
755
756.el-dialog__body {
757 padding: 30px 20px;
758 color: var(--el-text-color-regular);
759 font-size: var(--el-font-size-base);
760 word-break: break-all;
761}
762
763/* Drawer */
764.el-drawer {
765 position: absolute;
766 box-sizing: border-box;
767 background-color: var(--el-bg-color);
768 display: flex;
769 flex-direction: column;
770 box-shadow: 0 8px 10px -5px rgba(0,0,0,.2), 0 16px 24px 2px rgba(0,0,0,.14), 0 6px 30px 5px rgba(0,0,0,.12);
771 overflow: hidden;
772 outline: 0;
773}
774
775/* Loading */
776.el-loading-parent--relative {
777 position: relative !important;
778}
779
780.el-loading-parent--hidden {
781 overflow: hidden !important;
782}
783
784.el-loading-mask {
785 position: absolute;
786 z-index: 2000;
787 background-color: rgba(255, 255, 255, .9);
788 margin: 0;
789 top: 0;
790 right: 0;
791 bottom: 0;
792 left: 0;
793 transition: opacity var(--el-transition-duration) ease;
794}
795"#.to_string()
796}
797
798fn generate_navigation_styles() -> String {
799 r#"/* Navigation Component Styles */
800
801/* Menu */
802.el-menu {
803 border-right: solid 1px #e6e6e6;
804 list-style: none;
805 position: relative;
806 margin: 0;
807 padding-left: 0;
808 background-color: var(--el-bg-color);
809}
810
811.el-menu-item {
812 font-size: var(--el-font-size-base);
813 color: var(--el-text-color-primary);
814 padding: 0 20px;
815 cursor: pointer;
816 transition: border-color var(--el-transition-duration), background-color var(--el-transition-duration), color var(--el-transition-duration);
817 box-sizing: border-box;
818 white-space: nowrap;
819 height: 56px;
820 line-height: 56px;
821}
822
823.el-menu-item.is-active {
824 color: var(--el-color-primary);
825 border-right: 2px solid var(--el-color-primary);
826 background-color: var(--el-color-primary-light-9);
827}
828
829.el-menu-item:hover {
830 background-color: var(--el-color-primary-light-9);
831}
832
833/* Tabs */
834.el-tabs__header {
835 padding: 0;
836 position: relative;
837 margin: 0 0 15px 0;
838}
839
840.el-tabs__active-bar {
841 position: absolute;
842 bottom: 0;
843 left: 0;
844 height: 2px;
845 background-color: var(--el-color-primary);
846 z-index: 1;
847 transition: transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);
848 list-style: none;
849}
850
851.el-tabs__item {
852 padding: 0 20px;
853 height: 40px;
854 box-sizing: border-box;
855 line-height: 40px;
856 display: inline-block;
857 list-style: none;
858 font-size: var(--el-font-size-base);
859 font-weight: 500;
860 color: var(--el-text-color-regular);
861 position: relative;
862}
863
864.el-tabs__item.is-active {
865 color: var(--el-color-primary);
866}
867
868/* Dropdown */
869.el-dropdown {
870 display: inline-flex;
871 position: relative;
872 color: var(--el-text-color-regular);
873 font-size: var(--el-font-size-base);
874 line-height: 1;
875 cursor: pointer;
876}
877
878.el-dropdown-menu {
879 position: absolute;
880 top: 0;
881 left: 0;
882 z-index: 10;
883 padding: 10px 0;
884 margin: 5px 0;
885 background-color: var(--el-bg-color-overlay);
886 border: 1px solid #e4e7ed;
887 border-radius: var(--el-border-radius-base);
888 box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
889}
890
891/* Steps */
892.el-steps {
893 display: flex;
894}
895
896.el-step {
897 flex-shrink: 1;
898 position: relative;
899 flex-basis: 200px;
900 text-align: center;
901}
902
903.el-step__head {
904 position: relative;
905 display: inline-flex;
906 align-items: center;
907 justify-content: center;
908 width: 24px;
909 height: 24px;
910 font-size: var(--el-font-size-base);
911 color: var(--el-text-color-placeholder);
912 border: 2px solid;
913 border-radius: 50%;
914 background: var(--el-color-white);
915}
916
917.el-step__head.is-success {
918 color: var(--el-color-white);
919 background-color: var(--el-color-success);
920 border-color: var(--el-color-success);
921}
922
923.el-step__head.is-process {
924 color: var(--el-color-white);
925 background-color: var(--el-color-primary);
926 border-color: var(--el-color-primary);
927}
928
929/* Pagination */
930.el-pagination {
931 white-space: nowrap;
932 padding: 2px 5px;
933 color: var(--el-text-color-primary);
934 font-weight: 700;
935}
936
937.el-pagination button {
938 border: none;
939 padding: 0 6px;
940 background: transparent;
941 display: inline-block;
942 font-size: var(--el-font-size-base);
943 min-width: 35.5px;
944 height: 28px;
945 line-height: 28px;
946 cursor: pointer;
947 box-sizing: border-box;
948 text-align: center;
949}
950"#.to_string()
951}
952
953fn generate_additional_styles() -> String {
954 r#"/* Additional Component Styles */
955
956/* Badge */
957.el-badge {
958 position: relative;
959 vertical-align: middle;
960 display: inline-block;
961}
962
963.el-badge__content {
964 background-color: var(--el-color-danger);
965 border-radius: 10px;
966 color: var(--el-color-white);
967 display: inline-block;
968 font-size: var(--el-font-size-extra-small);
969 height: 18px;
970 line-height: 18px;
971 padding: 0 6px;
972 text-align: center;
973 white-space: nowrap;
974 border: 1px solid var(--el-color-white);
975}
976
977.el-badge__content.is-fixed {
978 position: absolute;
979 top: 0;
980 right: 10px;
981 transform: translateY(-50%) translateX(100%);
982}
983
984/* Tag */
985.el-tag {
986 background-color: var(--el-color-white);
987 border: 1px solid #dcdfe6;
988 border-radius: var(--el-border-radius-base);
989 color: var(--el-text-color-regular);
990 display: inline-block;
991 font-size: var(--el-font-size-extra-small);
992 height: 32px;
993 line-height: 30px;
994 padding: 0 10px;
995 box-sizing: border-box;
996 white-space: nowrap;
997 cursor: pointer;
998}
999
1000.el-tag--success {
1001 background-color: var(--el-color-success-light-9);
1002 border-color: var(--el-color-success-light-5);
1003 color: var(--el-color-success);
1004}
1005
1006.el-tag--warning {
1007 background-color: var(--el-color-warning-light-9);
1008 border-color: var(--el-color-warning-light-5);
1009 color: var(--el-color-warning);
1010}
1011
1012.el-tag--danger {
1013 background-color: var(--el-color-danger-light-9);
1014 border-color: var(--el-color-danger-light-5);
1015 color: var(--el-color-danger);
1016}
1017
1018.el-tag--info {
1019 background-color: var(--el-color-info-light-9);
1020 border-color: var(--el-color-info-light-5);
1021 color: var(--el-color-info);
1022}
1023
1024/* Avatar */
1025.el-avatar {
1026 display: inline-flex;
1027 justify-content: center;
1028 align-items: center;
1029 box-sizing: border-box;
1030 text-align: center;
1031 overflow: hidden;
1032 color: var(--el-color-white);
1033 background: #c0c4cc;
1034 width: 40px;
1035 height: 40px;
1036 font-size: var(--el-font-size-base);
1037 border-radius: 50%;
1038}
1039
1040/* Progress */
1041.el-progress {
1042 position: relative;
1043 line-height: 1;
1044 display: flex;
1045 align-items: center;
1046}
1047
1048.el-progress-bar {
1049 flex-grow: 1;
1050 box-sizing: border-box;
1051 margin-right: 10px;
1052 padding-right: 10px;
1053}
1054
1055.el-progress-bar__outer {
1056 height: 6px;
1057 border-radius: 100px;
1058 background-color: #ebeef5;
1059 overflow: hidden;
1060 position: relative;
1061}
1062
1063.el-progress-bar__inner {
1064 position: absolute;
1065 left: 0;
1066 top: 0;
1067 height: 100%;
1068 background-color: var(--el-color-primary);
1069 text-align: right;
1070 border-radius: 100px;
1071 line-height: 1;
1072 white-space: nowrap;
1073 transition: width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);
1074}
1075
1076/* Result */
1077.el-result {
1078 display: flex;
1079 justify-content: center;
1080 align-items: center;
1081 flex-direction: column;
1082 text-align: center;
1083 padding: 40px 30px;
1084}
1085
1086.el-result__title {
1087 font-size: var(--el-font-size-extra-large);
1088 color: var(--el-text-color-primary);
1089 margin-top: 20px;
1090 font-weight: 600;
1091}
1092
1093.el-result__subtitle {
1094 font-size: var(--el-font-size-base);
1095 color: var(--el-text-color-secondary);
1096 margin-top: 10px;
1097}
1098
1099/* Empty */
1100.el-empty {
1101 display: flex;
1102 justify-content: center;
1103 align-items: center;
1104 flex-direction: column;
1105 text-align: center;
1106 padding: 60px 0;
1107 margin: 0;
1108 background: var(--el-bg-color);
1109}
1110
1111.el-empty__image {
1112 width: 160px;
1113 opacity: .6;
1114}
1115
1116.el-empty__description {
1117 margin-top: 20px;
1118 color: var(--el-text-color-secondary);
1119 font-size: var(--el-font-size-base);
1120}
1121
1122/* Skeleton */
1123.el-skeleton {
1124 width: 100%;
1125}
1126
1127.el-skeleton__item {
1128 display: inline-block;
1129 background: #f2f3f5;
1130 border-radius: var(--el-border-radius-base);
1131 width: 100%;
1132 height: 16px;
1133}
1134
1135/* Tooltip */
1136.el-tooltip__popper {
1137 position: absolute;
1138 border-radius: var(--el-border-radius-base);
1139 padding: 10px;
1140 z-index: 2000;
1141 font-size: var(--el-font-size-base);
1142 line-height: 1.4;
1143 min-width: 10px;
1144 word-wrap: break-word;
1145 box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
1146}
1147
1148/* Divider */
1149.el-divider {
1150 position: relative;
1151}
1152
1153.el-divider--horizontal {
1154 display: block;
1155 height: 1px;
1156 width: 100%;
1157 margin: 24px 0;
1158}
1159
1160.el-divider--vertical {
1161 display: inline-block;
1162 width: 1px;
1163 height: 1em;
1164 margin: 0 8px;
1165 vertical-align: middle;
1166 position: relative;
1167}
1168
1169/* Backtop */
1170.el-backtop {
1171 position: fixed;
1172 background-color: var(--el-color-white);
1173 width: 40px;
1174 height: 40px;
1175 border-radius: 50%;
1176 display: flex;
1177 align-items: center;
1178 justify-content: center;
1179 font-size: 20px;
1180 box-shadow: 0 0 6px rgba(0,0,0,.12);
1181 cursor: pointer;
1182 z-index: 5;
1183 transition: var(--el-transition-all);
1184}
1185
1186/* Spin */
1187.el-spin {
1188 display: inline-flex;
1189 align-items: center;
1190 justify-content: center;
1191 vertical-align: middle;
1192}
1193
1194.el-spin__spinner {
1195 animation: loading-rotate 2s linear infinite;
1196}
1197
1198@keyframes loading-rotate {
1199 100% {
1200 transform: rotate(360deg);
1201 }
1202}
1203
1204/* Placeholder for additional component styles */
1205.el-affix {
1206 position: relative;
1207}
1208
1209.el-affix--fixed {
1210 position: fixed;
1211 z-index: 10;
1212}
1213"#.to_string()
1214}
1215
1216pub const COMPLETE_CSS: &str = ""; #[cfg(test)]
1220mod tests {
1221 use super::*;
1222
1223 #[test]
1224 fn test_css_generation() {
1225 let css = all_styles();
1226 assert!(!css.is_empty());
1227 assert!(css.contains("el-button"));
1228 assert!(css.contains("el-input"));
1229 assert!(css.contains("var(--el-color-primary)"));
1230 }
1231}