Clean up icons
Clean up duplicate svg icons from assets directory.
Created a statusIcon component to dynamically render
status icons instead of using background-image in
scss files.
- Moved/removed on, off, critical, warning svg icons from
assets directory
- Updated background-image status icons to use <icon>
or <status-icon> directive
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: Ic0f06d78b0861d6f60d40b2dcc0b80fd6dad2a88
diff --git a/app/common/styles/elements/alerts.scss b/app/common/styles/elements/alerts.scss
index fe1082e..694d2a6 100644
--- a/app/common/styles/elements/alerts.scss
+++ b/app/common/styles/elements/alerts.scss
@@ -31,6 +31,7 @@
margin-bottom: 24px;
border-style: solid;
border-width: 1px;
+ position: relative;
}
.notification-banner__text {
@@ -47,15 +48,16 @@
.notification-banner--warning {
background-color: $accent-03--03;
border-color: $accent-03--02;
+ .icon {
+ position: absolute;
+ left: 10px;
+ top: 8px;
+ bottom: 8px;
+ width: 18px;
+ height: 30px;
+ margin: auto;
+ }
.notification-banner__text {
- &::before {
- content: '';
- display: inline-block;
- width: 18px;
- height: 18px;
- vertical-align: bottom;
- margin-right: 0.5em;
- background-image: url(../assets/images/icon-warning.svg);
- }
+ padding-left: 24px;
}
}
diff --git a/app/common/styles/elements/index.scss b/app/common/styles/elements/index.scss
index 66a2877..b1df113 100644
--- a/app/common/styles/elements/index.scss
+++ b/app/common/styles/elements/index.scss
@@ -1,6 +1,5 @@
@import "toggle-switch";
@import "toggle-filter";
-@import "status";
@import "alerts";
@import "inline-confirm";
@import "input-file";
diff --git a/app/common/styles/elements/status.scss b/app/common/styles/elements/status.scss
deleted file mode 100644
index b6cdc9d..0000000
--- a/app/common/styles/elements/status.scss
+++ /dev/null
@@ -1,68 +0,0 @@
-//status light states
-@mixin status-light-before {
- content: '';
- display: inline-block;
- margin-right: -12%;
- transform: translateY(-2px);
- left: 0;
- top: 0;
- width: 16px;
- height: 16px;
- position: absolute;
-}
-
-@mixin status-light-header {
- padding-left: 1.6em;
- margin-top: .7em;
- position: relative;
-}
-@mixin status-light__good {
- @include status-light-before;
-}
-
-@mixin status-light__error {
- @include status-light-before;
-}
-
-@mixin status-light__disabled {
- @include status-light-before;
-}
-
-@mixin status-light__warn {
- @include status-light-before;
-
-}
-
-.status-light__disabled,
-.status-light__off{
- @include status-light-header;
- &::before {
- @include status-light__disabled;
- @extend .icon__off;
- }
-}
-
-.status-light__good {
- @include status-light-header;
- &::before {
- @include status-light__good;
- @extend .icon__good;
- }
-}
-
-.status-light__error {
- @include status-light-header;
- &::before {
- @include status-light__error;
- @extend .icon__critical;
- }
-
-}
-
-.status-light__warn {
- @include status-light-header;
- &::before {
- @include status-light__warn;
- @extend .icon__warning;
- }
-}
\ No newline at end of file