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
mgr/dashboard: Color variables for color codes #22695
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have a centralized file for color, I notice that we have a lot of whites and greys that look the same.
Would it be possible to reduce that? maybe 3 of each?
@@ -1,3 +1,5 @@ | |||
@import '../../../../defaults'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This import is not being used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, will remove it.
@@ -30,11 +30,6 @@ | |||
CSS Fix | |||
*/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the colors in this file should also be extracted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
@@ -63,7 +63,7 @@ | |||
} | |||
.input-group { | |||
float: right; | |||
border-left: 1px solid rgba(0,0,0,.09); | |||
border-left: $border-color-white; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we extract the whole rule or just the color?
Do you think we will need to change the border size and texture when customizing the template?
If we extracted just the color we might be able to reduce the number of color variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, it is better to assign variable just to color.
@tspmelo, ack, will reduce the colors by eliminating similar shades. |
/*Table Component*/ | ||
$color-off-white: #f5f5f5; | ||
$color-mild-white: #f6f6f6; | ||
$border-color-white: 1px solid rgba(0,0,0,.09); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should split that and set the border style in the table component scss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice step to put all color literals into a single place, but pushing things a bit further: what about using a color naming scheme that describe the meaning/intention of the element colored instead of simply describing the color shade?
Let me put an example: instead of color-solid-red
, what about color-health-error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. But i would like to see something like this to make it really really simple:
$color-solid-red: #FF0000;
$color-health-error: $color-solid-red;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
$color-light-white: #f9f9f9; | ||
$color-solid-white: #fafafa; | ||
$color-gallery-gray: #ededed; | ||
$border-color-gray: 1px solid #d1d1d1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should split that and set the border style in the table component scss.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
5901e9f
to
2f41a4a
Compare
jenkins test make check |
@@ -62,26 +64,25 @@ export class HealthComponent implements OnInit, OnDestroy { | |||
|
|||
preparePoolUsage(chart, data) { | |||
const colors = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not using a colour generator/random colours? Even better if it copes with color blindness (8% population affecting).
- I've seen that the AngularJS ChartJS module includes a random generator.
- A solutions based on palette.js and another.
- And here you can find a discussion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I will take a look.
@@ -0,0 +1,4 @@ | |||
form .input-group-addon { | |||
color: #a2a2a2 !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding a literal color here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to remove it. Will replace it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. Looks almost perfect. Just a few comments and the colour palette generator suggestion. Thanks.
@@ -0,0 +1,195 @@ | |||
/* Branding */ | |||
.navbar-openattic { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're removing openattic specific namings, why leaving this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, will change this.
@@ -1,1144 +0,0 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you removed this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this file and copied all important and global classes and styles to styles.scss file.
757e309
to
480273b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just check my comments, but this looks overall good to me!
@import 'defaults'; | ||
$fa-font-path: "../node_modules/fork-awesome/fonts"; | ||
@import "../node_modules/fork-awesome/scss/fork-awesome"; | ||
@import 'src/app/core/navigation/navigation.module'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd try to either move that CSS code back here or leave it as a component CSS one, but not both ways, as I find it might be confusing. Try the suggestion by @alfonsomthd to change the view encapsulation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not common practice to create .scss
files for modules.
If there is no parent component where you can add this rules, I would suggest you do what we did for the popover
styles: create a styles/navigation.scss
file and import it in every component you need it.
"node_modules/chart.js/dist/Chart.bundle.js" | ||
"node_modules/angular/angular.js", | ||
"node_modules/chart.js/dist/Chart.bundle.js", | ||
"node_modules/angular-chart.js/dist/angular-chart.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with this one and we then may try with a more advanced color schemer.
@@ -69,6 +69,7 @@ | |||
"@types/jasminewd2": "2.0.3", | |||
"@types/jest": "23.1.2", | |||
"@types/node": "8.10.20", | |||
"angular-chart.js": "^1.1.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be careful when adding new dependencies.
- This package is targetted at Angular.js and is not supported by the current version of Angular.
- We already have a package that wraps
Chart.js
for Angular,ng2-charts
. - When adding a new dependency please remove the
^
and~
from the version. - Since this package would have been used in the final version of the dashboard, it should have been added to the dependencies section, the devDependencies section is specific for packages that are used during the dev steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
"node_modules/chart.js/dist/Chart.bundle.js" | ||
"node_modules/angular/angular.js", | ||
"node_modules/chart.js/dist/Chart.bundle.js", | ||
"node_modules/angular-chart.js/dist/angular-chart.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted.
Please read the reason in my previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
@@ -1,11 +1,11 @@ | |||
<div class="chart-container"> | |||
<canvas baseChart | |||
#chartCanvas | |||
class="chart chart-doughnut" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed. We are already defining the chart using the chartType
attribute.
|
||
/* Navbar */ | ||
margin-bottom: 0; | ||
background: $color-navbar-bg; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems @import '../../../../defaults';
is missing.
background-image: -webkit-linear-gradient(top,#fafafa 0,#ededed 100%); | ||
background-image: -o-linear-gradient(top,#fafafa 0,#ededed 100%); | ||
background-image: linear-gradient(to bottom,#fafafa 0,#ededed 100%); | ||
background-color: red; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use a variable here?
|
||
.modal-header { | ||
@include hf; | ||
border-radius: 5px 5px 0 0; | ||
} | ||
|
||
.modal-footer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this rule not being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didnt see it being used anywhere, also, when I removed it as well, the modal remained unaffected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually necessary.
You will need to add the ::ng-deep
, so it can be applied.
You will notice the color of the background will change.
@import 'defaults'; | ||
$fa-font-path: "../node_modules/fork-awesome/fonts"; | ||
@import "../node_modules/fork-awesome/scss/fork-awesome"; | ||
@import 'src/app/core/navigation/navigation.module'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not common practice to create .scss
files for modules.
If there is no parent component where you can add this rules, I would suggest you do what we did for the popover
styles: create a styles/navigation.scss
file and import it in every component you need it.
bb26f1c
to
3b8e324
Compare
Found a few places that need fix:
|
@tspmelo, Corrected the styles for the following :- |
jenkins test make check |
4abbfa3
to
208f88d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You removed the margin-right-sm
class from styles.scss
, and because of that you are missing the following fix: #22759
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
margin-left: 5px; | ||
} | ||
|
||
// awesome-bootstrap-checkbox + ForkAwesome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rules are required for displaying the awesome-checkbox icons.
You can try it in the login page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
@@ -15,3 +15,7 @@ table.ceph-chartbox { | |||
height: 120px; | |||
width: 120px; | |||
} | |||
|
|||
::ng-deep .nav-tabs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a global rule.
We also use this in other pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
@@ -0,0 +1,10 @@ | |||
.osd-modal { | |||
margin: 10px 0px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could remove both this rules and just keep the .oa-hr-small
.
The others are already taken care of by bootstrap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
|
||
.modal-header { | ||
@include hf; | ||
border-radius: 5px 5px 0 0; | ||
} | ||
|
||
.modal-footer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually necessary.
You will need to add the ::ng-deep
, so it can be applied.
You will notice the color of the background will change.
You are missing the |
font-weight: normal; | ||
font-style: normal; | ||
} | ||
/*For Opera browser*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems Opera is no longer a problem. I'm guessing since they are now using the same render as Chrome.
This can be replaced by:
/* For awesome-bootstrap-checkbox */
.checkbox input[type='checkbox']:checked + label:after {
font-family: $font_family_1;
}
/*******/
Also, please don't use tabs, we use 2 spaces for indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
Assign variables to colors present in css files Changed navigation icons padding because the notification dropdown was going out of window. Fixes: http://tracker.ceph.com/issues/24575 Signed-off-by: Kanika Murarka <kmurarka@redhat.com>
Assign variables to colors present in css files
Changed navigation icons padding because the notification dropdown was going out of window.
Fixes: http://tracker.ceph.com/issues/24575
Signed-off-by: Kanika Murarka kmurarka@redhat.com