Skip to content

Commit 31fb6bd

Browse files
committed
feat: add icon component, and progress group
1 parent 436cbb7 commit 31fb6bd

File tree

6 files changed

+107
-0
lines changed

6 files changed

+107
-0
lines changed

scss/_icon.scss

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.c-icon {
2+
display: inline-block;
3+
color: inherit;
4+
text-align: center;
5+
fill: currentColor;
6+
&:not(.c-icon-c-s):not(.c-icon-custom-size) {
7+
@include icon-size($icon-size-base);
8+
9+
// TODO: create variable with a range
10+
@for $i from 2 through 9 {
11+
&.c-icon-#{$i}xl {
12+
@include icon-size($i * ($icon-size-xl / 1.5));
13+
}
14+
}
15+
16+
&.c-icon-xl {
17+
@include icon-size($icon-size-xl);
18+
}
19+
20+
&.c-icon-lg {
21+
@include icon-size($icon-size-lg);
22+
}
23+
24+
&.c-icon-sm {
25+
@include icon-size($icon-size-sm);
26+
}
27+
}
28+
}

scss/_mixins.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
@import "mixins/list-group";
2929
@import "mixins/forms";
3030
@import "mixins/table-variants";
31+
@import "mixins/icon";
3132

3233
// Skins
3334
@import "mixins/border-radius";

scss/_progress.scss

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,68 @@
4343
}
4444
}
4545
}
46+
47+
.progress-xs {
48+
height: 4px;
49+
}
50+
51+
.progress-sm {
52+
height: 8px;
53+
}
54+
55+
// White progress bar
56+
.progress.progress-white {
57+
background-color: rgba(255, 255, 255, .2);
58+
.progress-bar {
59+
background-color: $white;
60+
}
61+
}
62+
63+
//TODO: move all values to variables.scss
64+
.progress-group {
65+
display: flex;
66+
flex-flow: row wrap;
67+
margin-bottom: $spacer;
68+
}
69+
70+
.progress-group-prepend {
71+
flex: 0 0 100px;
72+
align-self: center;
73+
}
74+
75+
.progress-group-icon {
76+
font-size: $font-size-lg;
77+
margin: 0 $spacer 0 ($spacer * .25);
78+
79+
// @include ltr {
80+
// margin: 0 $spacer 0 ($spacer * .25);
81+
// }
82+
// @include rtl {
83+
// margin: 0 ($spacer * .25) 0 $spacer;
84+
// }
85+
}
86+
87+
.progress-group-text {
88+
font-size: $font-size-sm;
89+
color: $gray-700;
90+
}
91+
92+
.progress-group-header {
93+
display: flex;
94+
flex-basis: 100%;
95+
align-items: flex-end;
96+
margin-bottom: ($spacer * .25);
97+
}
98+
99+
.progress-group-bars {
100+
flex-grow: 1;
101+
align-self: center;
102+
103+
.progress:not(:last-child) {
104+
margin-bottom: 2px;
105+
}
106+
}
107+
108+
.progress-group-header + .progress-group-bars {
109+
flex-basis: 100%;
110+
}

scss/_variables.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,12 @@ $list-inline-padding: .5rem !default;
525525

526526
$mark-bg: #fcf8e3 !default;
527527

528+
// Icons
529+
$icon-size-base: 1rem !default;
530+
$icon-size-sm: $icon-size-base * .875 !default;
531+
$icon-size-lg: $icon-size-base * 1.25 !default;
532+
$icon-size-xl: $icon-size-base * 1.5 !default;
533+
528534

529535
// Tables
530536
//

scss/coreui.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
@import "carousel";
4545
@import "spinners";
4646
@import "header";
47+
@import "icon";
4748
@import "sidebar";
4849

4950
// Helpers

scss/mixins/_icon.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Icon sizes
2+
@mixin icon-size($icon-size) {
3+
width: $icon-size;
4+
height: $icon-size;
5+
font-size: $icon-size;
6+
}

0 commit comments

Comments
 (0)