Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(alert): Eva theme #1406

Merged
merged 9 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 36 additions & 113 deletions src/framework/theme/components/alert/_alert.component.theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,123 +16,27 @@

@mixin nb-alert-theme() {
nb-alert {
font-size: nb-theme(alert-font-size);
line-height: nb-theme(alert-line-height);
font-weight: nb-theme(alert-font-weight);

background: nb-theme(alert-bg);
color: nb-theme(alert-outline-fg);
// TODO: move alert margin style to layout
margin-bottom: nb-theme(alert-margin);
background-color: nb-theme(alert-background-color);
border-radius: nb-theme(alert-border-radius);
box-shadow: nb-theme(alert-shadow);
color: nb-theme(alert-text-color);
font-family: nb-theme(alert-text-font-family);
font-size: nb-theme(alert-text-font-size);
font-weight: nb-theme(alert-text-font-weight);
line-height: nb-theme(alert-text-line-height);
padding: nb-theme(alert-padding);

@include nb-scrollbars(
nb-theme(scrollbar-fg),
nb-theme(scrollbar-bg),
nb-theme(scrollbar-width));

&.status {
color: nb-theme(alert-fg);
}

&.xxsmall-alert {
height: nb-theme(alert-height-xxsmall);
}
&.xsmall-alert {
height: nb-theme(alert-height-xsmall);
}
&.small-alert {
height: nb-theme(alert-height-small);
}
&.medium-alert {
height: nb-theme(alert-height-medium);
}
&.large-alert {
height: nb-theme(alert-height-large);
}
&.xlarge-alert {
height: nb-theme(alert-height-xlarge);
}
&.xxlarge-alert {
height: nb-theme(alert-height-xxlarge);
}

&.active-alert {
background-color: nb-theme(alert-active-bg);
}
&.disabled-alert {
background-color: nb-theme(alert-disabled-bg);
color: nb-theme(alert-disabled-fg);
}
&.primary-alert {
background-color: nb-theme(alert-primary-bg);
}
&.info-alert {
background-color: nb-theme(alert-info-bg);
}
&.success-alert {
background-color: nb-theme(alert-success-bg);
}
&.warning-alert {
background-color: nb-theme(alert-warning-bg);
}
&.danger-alert {
background-color: nb-theme(alert-danger-bg);
}

&.accent {
border-top-style: solid;
border-top-width: nb-theme(alert-border-radius);

& nb-alert-header {
border-radius: 0;
}
}
// TODO: move alert margin style to layout
margin-bottom: nb-theme(alert-bottom-margin);

&.accent-active {
border-top-color: nb-theme(alert-active-bg);
}
&.accent-disabled {
border-top-color: nb-theme(alert-disabled-bg);
}
&.accent-primary {
border-top-color: nb-theme(alert-primary-bg);
}
&.accent-success {
border-top-color: nb-theme(alert-success-bg);
}
&.accent-info {
border-top-color: nb-theme(alert-info-bg);
}
&.accent-warning {
border-top-color: nb-theme(alert-warning-bg);
}
&.accent-danger {
border-top-color: nb-theme(alert-danger-bg);
}
@include nb-scrollbars(
nb-theme(alert-scrollbar-color),
nb-theme(alert-scrollbar-background-color),
nb-theme(alert-scrollbar-width));

&.outline-active {
border: 2px solid nb-theme(alert-active-bg);
}
&.outline-disabled {
border: 2px solid nb-theme(alert-disabled-bg);
}
&.outline-primary {
border: 2px solid nb-theme(alert-primary-bg);
}
&.outline-success {
border: 2px solid nb-theme(alert-success-bg);
}
&.outline-info {
border: 2px solid nb-theme(alert-info-bg);
}
&.outline-warning {
border: 2px solid nb-theme(alert-warning-bg);
}
&.outline-danger {
border: 2px solid nb-theme(alert-danger-bg);
&.closable {
@include nb-ltr(padding-right, nb-theme(alert-closable-start-padding));
@include nb-rtl(padding-left, nb-theme(alert-closable-start-padding));
}

.close {
Expand All @@ -142,9 +46,28 @@
cursor: pointer;
font-family: monospace;
}
}

&.closable {
padding-right: nb-theme(alert-closable-padding);
@each $size in nb-get-sizes() {
nb-alert.size-#{$size} {
height: nb-theme(alert-#{$size}-height);
}
}

@each $status in nb-get-statuses() {
nb-alert {
&.status-#{$status} {
color: nb-theme(alert-#{$status}-text-color);
background-color: nb-theme(alert-#{$status}-background-color);
}

&.accent-#{$status} {
border-top: nb-theme(alert-border-radius) solid nb-theme(alert-accent-#{$status}-color);
}

&.outline-#{$status} {
border: nb-theme(alert-outline-width) solid nb-theme(alert-outline-#{$status}-color);
}
}
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/framework/theme/components/alert/alert.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@import '../../styles/core/mixins';

:host {
display: flex;
flex-direction: column;
position: relative;

.close {
@include nb-ltr(right, 0);
@include nb-rtl(left, 0);
}
}

.close {
position: absolute;
top: 0;
right: 0;
color: inherit;
background-color: transparent;
border: 0;
-webkit-appearance: none;
appearance: none;
}
Loading