N°2847 - Alert & Panel: Add top spacing, fix border-radius and reorder some parts of the SCSS

This commit is contained in:
Molkobain
2020-08-26 22:06:55 +02:00
parent 825c70c001
commit 0bef32cf8d
2 changed files with 124 additions and 72 deletions

View File

@@ -1,6 +1,26 @@
/*!
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
/* SCSS variables */
$ibo-alert--spacing-top: 6px !default;
$ibo-alert--padding-y: 18px !default; $ibo-alert--padding-y: 18px !default;
$ibo-alert--padding-x: 20px !default; $ibo-alert--padding-x: 20px !default;
$ibo-alert--border-radius: 2px !default; $ibo-alert--border-radius: $ibo-border-radius-300 !default;
$ibo-alert--title--padding-bottom: 4px !default; $ibo-alert--title--padding-bottom: 4px !default;
@@ -26,40 +46,47 @@ $ibo-alert-colors: (
'pink': ($ibo-color-pink-200, $ibo-color-pink-700, $ibo-color-pink-900), 'pink': ($ibo-color-pink-200, $ibo-color-pink-700, $ibo-color-pink-900),
) !default; ) !default;
@each $sColor, $aColorValues in $ibo-alert-colors{ @each $sColor, $aColorValues in $ibo-alert-colors {
$bg-color: nth($aColorValues, 1); $bg-color: nth($aColorValues, 1);
$highlight-color: nth($aColorValues, 2); $highlight-color: nth($aColorValues, 2);
$text-color: nth($aColorValues, 3); $text-color: nth($aColorValues, 3);
.ibo-alert.ibo-is-#{$sColor}{ .ibo-alert.ibo-is-#{$sColor} {
background-color: $bg-color; background-color: $bg-color;
color: $text-color; color: $text-color;
&::before{
background-color: $highlight-color; &::before {
} background-color: $highlight-color;
} }
}
} }
.ibo-alert{ /* Rules */
position: relative; .ibo-alert {
padding: $ibo-alert--padding-y $ibo-alert--padding-x; position: relative;
border-radius: $ibo-alert--border-radius; padding: $ibo-alert--padding-y $ibo-alert--padding-x;
border-radius: $ibo-alert--border-radius;
@extend %ibo-font-ral-med-150; overflow: hidden; /* To force highlight color to be cropped by the border radius */
.ibo-alert--title{
padding-bottom: $ibo-alert--title--padding-bottom;
@extend %ibo-font-ral-bol-150;
}
}
.ibo-alert::before{
display: block;
position: absolute;
top: 0;
left: 0;
content: '';
border-radius: $ibo-alert--border-radius 0 0 $ibo-alert--border-radius; @extend %ibo-font-ral-med-150;
width: $ibo-alert--title--highlight--width;
height: $ibo-alert--title--highlight--height; &::before {
display: block;
position: absolute;
top: 0;
left: 0;
content: '';
width: $ibo-alert--title--highlight--width;
height: $ibo-alert--title--highlight--height;
}
.ibo-alert--title {
padding-bottom: $ibo-alert--title--padding-bottom;
@extend %ibo-font-ral-bol-150;
}
}
.ibo-alert + .ibo-alert {
margin-top: $ibo-alert--spacing-top;
} }

View File

@@ -1,3 +1,38 @@
/*!
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
/* SCSS variables */
$ibo-panel--spacing-top: 24px !default;
$ibo-panel--highlight--width: 100% !default;
$ibo-panel--highlight--height: 5px !default;
$ibo-panel--highlight--border-radius: $ibo-border-radius-400 $ibo-border-radius-400 0 0 !default;
$ibo-panel--highlight--padding-bottom: 5px !default;
$ibo-panel--title--color: $ibo-color-grey-900 !default;
$ibo-panel--body--background-color: $ibo-color-white-100 !default;
$ibo-panel--body--padding-y: 15px !default;
$ibo-panel--body--padding-x: 10px !default;
$ibo-panel--body--border-radius: $ibo-border-radius-500 !default;
$ibo-panel--body--border-size: 1px !default;
$ibo-panel--body--border-color: $ibo-color-grey-400 !default;
$ibo-panel-colors: ( $ibo-panel-colors: (
'primary': $ibo-color-primary-600, 'primary': $ibo-color-primary-600,
'secondary': $ibo-color-secondary-600, 'secondary': $ibo-color-secondary-600,
@@ -17,47 +52,37 @@ $ibo-panel-colors: (
'pink': $ibo-color-pink-600, 'pink': $ibo-color-pink-600,
) !default; ) !default;
$ibo-panel--highlight--width: 100% !default; @each $sColor, $sColorValue in $ibo-panel-colors {
$ibo-panel--highlight--height: 5px !default; .ibo-panel.ibo-is-#{$sColor} > .ibo-panel--body::before {
$ibo-panel--highlight--border-radius: $ibo-border-radius-400 $ibo-border-radius-400 0 0 !default; position: absolute;
$ibo-panel--highlight--padding-bottom: 5px !default; top: 0;
left: 0;
display: block;
$ibo-panel--title--color: $ibo-color-grey-900 !default; background-color: $sColorValue;
content: "";
$ibo-panel--body--background-color: $ibo-color-white-100 !default; width: $ibo-panel--highlight--width;
$ibo-panel--body--padding-y: 15px !default; height: $ibo-panel--highlight--height;
$ibo-panel--body--padding-x: 10px !default; padding-bottom: $ibo-panel--highlight--padding-bottom;
$ibo-panel--body--border-radius: $ibo-border-radius-500 !default; }
$ibo-panel--body--border-size: 1px !default; }
$ibo-panel--body--border-color: $ibo-color-grey-400 !default;
@each $sColor, $sColorValue in $ibo-panel-colors{ /* Rules */
.ibo-panel.ibo-is-#{$sColor} > .ibo-panel--body::before{ .ibo-panel + .ibo-panel {
position: absolute; margin-top: $ibo-panel--spacing-top;
top: 0;
left: 0;
display: block;
background-color: $sColorValue;
content: "";
width: $ibo-panel--highlight--width;
height: $ibo-panel--highlight--height;
border-radius: $ibo-panel--highlight--border-radius;
padding-bottom: $ibo-panel--highlight--padding-bottom;
}
} }
.ibo-panel + .ibo-panel{
margin-top: 15px; .ibo-panel--title {
color: $ibo-panel--title--color;
@extend %ibo-font-ral-med-350;
} }
.ibo-panel--title{
color: $ibo-panel--title--color; .ibo-panel--body {
@extend %ibo-font-ral-med-350; position: relative;
} padding: $ibo-panel--body--padding-y $ibo-panel--body--padding-x;
.ibo-panel--body{ background-color: $ibo-panel--body--background-color;
position: relative; border: solid $ibo-panel--body--border-size $ibo-panel--body--border-color;
padding: $ibo-panel--body--padding-y $ibo-panel--body--padding-x; border-radius: $ibo-panel--body--border-radius;
border-radius: $ibo-panel--body--border-radius; overflow: hidden; /* To force highlight color to be cropped by the border radius */
border: solid $ibo-panel--body--border-size $ibo-panel--body--border-color;
background-color: $ibo-panel--body--background-color;
} }