Skip to content

Commit

Permalink
Fix text alignment in multiline Alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Dec 6, 2019
1 parent 2464055 commit 47be0cb
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion demo/generated/demo.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lib.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-ui-org/react-ui",
"version": "0.22.0",
"version": "0.22.1",
"license": "MIT",
"main": "dist/lib.js",
"repository": {
Expand Down
14 changes: 5 additions & 9 deletions src/lib/components/ui/Alert/Alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@
}

.icon {
position: absolute;
left: $alert-offset;
position: relative;
top: 1px;
display: flex;
flex-direction: column;
align-items: center;
align-self: flex-start;
justify-content: flex-start;
height: 100%;
padding-top: calc((#{$alert-min-height} - (2 * #{$alert-border-width}) - #{$alert-icon-size}) / 2);
}

.message {
padding-left: $alert-offset;
padding-left: $alert-padding;
font-weight: $alert-message-font-weight;
font-size: $alert-font-size;
line-height: $alert-line-height;

&:not(:first-child) {
padding-left: calc(#{$alert-icon-size} + #{$alert-offset});
}
}

.message strong {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/Alert/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
align-items: center;
width: 100%;
min-height: $alert-min-height;
padding: $alert-offset;
padding: $alert-padding;
border-width: $alert-border-width $alert-border-width $alert-border-width $alert-stripe-width;
border-style: solid;
border-radius: $alert-border-radius;
Expand Down
1 change: 1 addition & 0 deletions src/lib/components/ui/Alert/_theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
$alert-border-width: var(--rui-alert-border-width);
$alert-border-radius: var(--rui-alert-border-radius);
$alert-padding: var(--rui-alert-padding);
$alert-icon-size: var(--rui-icon-size-default);

$alert-types: (
Expand Down
8 changes: 6 additions & 2 deletions src/lib/components/ui/Alert/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@import '../../../styles/settings/colors';
@import '../../../styles/settings/offsets';
@import '../../../styles/settings/typography';
@import './theme';

$alert-font-size: map-get($typography-size-values, 0);
$alert-line-height: 1.2;
$alert-min-height: 30px;
$alert-offset: map-get($offset-values, 1);
$alert-min-height:
calc(
#{$alert-font-size} * #{$alert-line-height} + 2 * #{$alert-padding} + 2 * #{$alert-border-width}
);
$alert-stripe-width: 5px;
$alert-message-font-weight: map-get($typography-font-weight-values, light);
$alert-title-font-weight: map-get($typography-font-weight-values, bold);
1 change: 1 addition & 0 deletions src/lib/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
// Alerts: common properties
--rui-alert-border-width: var(--rui-border-width);
--rui-alert-border-radius: var(--rui-border-radius);
--rui-alert-padding: var(--rui-offset-1);

// Alerts: type: success
--rui-alert-success-foreground-color: var(--rui-color-success);
Expand Down

0 comments on commit 47be0cb

Please sign in to comment.