Skip to content

Commit 7e782fc

Browse files
authored
refactor(SvgIcon): add css variable (#4394)
* refactor: 增加 Icon 图标大小变量 * refactor: SvgIcon 增加样式变量
1 parent 38acb2f commit 7e782fc

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

src/BootstrapBlazor/Components/Icon/BootstrapBlazorIcon.razor.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.bb-icon {
2-
--bb-icon-width: 12px;
2+
--bb-icon-width: #{$bb-icon-width};
33
--bb-icon-color: var(--bs-body-color);
44
display: inline-flex;
55

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
.bb-svg-icon {
2-
--bb-svg-icon-width: 12px;
1+
.bb-svg-icon {
2+
--bb-svg-icon-width: #{$bb-svg-icon-width};
33
--bb-svg-icon-color: var(--bs-body-color);
44
display: inline-flex;
5-
}
65

7-
.bb-svg-icon > svg {
6+
> svg {
87
width: var(--bb-svg-icon-width);
98
height: var(--bb-svg-icon-width);
10-
}
119

12-
.bb-svg-icon > svg > * {
10+
> * {
1311
stroke: var(--bb-svg-icon-color);
1412
}
13+
}
14+
}

src/BootstrapBlazor/wwwroot/scss/components.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
@import "../../Components/GroupBox/GroupBox.razor.scss";
4848
@import "../../Components/Handwritten/Handwritten.razor.scss";
4949
@import "../../Components/Icon/BootstrapBlazorIcon.razor.scss";
50+
@import "../../Components/Icon/SvgIcon.razor.scss";
5051
@import "../../Components/IFrame/IFrame.razor.scss";
5152
@import "../../Components/ImagePreviewer/ImagePreviewer.razor.scss";
5253
@import "../../Components/ImageViewer/ImageViewer.razor.scss";

src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ $bb-groupbox-legend-padding: 0 .5rem;
306306
$bb-groupbox-legend-left: 1rem;
307307
$bb-groupbox-legend-top: -10px;
308308

309+
// Icon
310+
$bb-icon-width: 12px;
311+
312+
// Icon Svg
313+
$bb-svg-icon-width: 12px;
314+
309315
// ImagePreviewer
310316
$bb-viewer-button-bg: #606266;
311317
$bb-viewer-border-radius: 50%;

0 commit comments

Comments
 (0)