Skip to content

Added Less css pre-processing #392

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

Merged
merged 4 commits into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
29 changes: 19 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ module.exports = function (grunt) {
dest: 'docs',
expand: true
},
styles: {
cwd: 'styles/',
src: ['*.css', '!*.min.css'],
dest: 'dist/styles',
expand: true
},
img: {
cwd: 'misc/',
src: 'patternfly-orb.svg',
Expand All @@ -84,11 +78,22 @@ module.exports = function (grunt) {
expand: true
}
},
less: {
patternfly: {
files: {
'dist/styles/angular-patternfly.css': 'styles/angular-patternfly.less'
},
options: {
paths: ['src/less/'],
strictMath: true
}
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: 'styles',
cwd: 'dist/styles',
src: ['*.css', '!*.min.css'],
dest: 'dist/styles',
ext: '.min.css'
Expand Down Expand Up @@ -265,6 +270,10 @@ module.exports = function (grunt) {
files: ['Gruntfile.js'],
tasks: ['eslint']
},
less: {
files: ['**/*.less'],
tasks: ['less']
},
test: {
files: ['test/**/*.js'],
tasks: ['test']
Expand All @@ -279,7 +288,7 @@ module.exports = function (grunt) {
}
});

grunt.registerTask('copymain', ['copy:docdata', 'copy:fa', 'copy:styles', 'copy:img']);
grunt.registerTask('copymain', ['copy:docdata', 'copy:fa', 'copy:img']);

// You can specify which modules to build as arguments of the build task.
grunt.registerTask('build', 'Create bootstrap build files', function () {
Expand All @@ -299,13 +308,13 @@ module.exports = function (grunt) {
concatSrc = 'src/**/*.js';
}

grunt.task.run(['clean', 'lint', 'test', 'ngtemplates', 'concat', 'ngAnnotate', 'uglify:build', 'cssmin', 'copymain', 'ngdocs', 'clean:templates']);
grunt.task.run(['clean', 'lint', 'test', 'ngtemplates', 'concat', 'ngAnnotate', 'uglify:build', 'less', 'cssmin', 'copymain', 'ngdocs', 'clean:templates']);
});

// Runs all the tasks of build with the exception of tests
grunt.registerTask('deploy', 'Prepares the project for deployment. Does not run unit tests', function () {
var concatSrc = 'src/**/*.js';
grunt.task.run(['clean', 'lint', 'ngtemplates', 'concat', 'ngAnnotate', 'uglify:build', 'cssmin', 'copymain', 'ngdocs', 'clean:templates']);
grunt.task.run(['clean', 'lint', 'ngtemplates', 'concat', 'ngAnnotate', 'uglify:build', 'less', 'cssmin', 'copymain', 'ngdocs', 'clean:templates']);
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the less files should be added to the watch section so updates can be seen during development without rebuilding

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are, there is a less task under the watch task.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah sorry, I just saw it still watching styles//*.css and missed the less section. Might want to remove the styles//*.css from the all section


grunt.registerTask('default', ['build']);
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"grunt-contrib-concat": "0.3.0",
"grunt-contrib-connect": "0.5.0",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-cssmin": "0.9.0",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-less": "^1.3.0",
"grunt-contrib-jshint": "0.7.0",
"grunt-contrib-uglify": "0.2.5",
"grunt-contrib-watch": "0.5.3",
Expand Down
73 changes: 73 additions & 0 deletions src/card/card.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
.card-pf-aggregate-status-alt {
.card-pf-body {
padding-bottom: 20px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use variable here as in patternfly: (@grid-gutter-width / 2)

}
.card-pf-title {
font-weight: 300;
line-height: 22px;
margin: 20px 0 10px 0;
}
.card-pf-aggregate-status-count {
font-size: 24px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fonts should be expressed in terms of @font-size-base (@font-size-base * 2) in this case

}
.card-pf-aggregate-status-title {
display: block;
font-size: 12px;
}
.card-pf-aggregate-status-notifications {
.card-pf-aggregate-status-notification {
border-left: none;
}
.fa {
position: relative;
top: -1px;
}
.pficon {
position: relative;
top: -1px;
}
}
}
.card-pf-heading-no-bottom {
margin: 0 -20px 0px;
padding: 0 20px 0;
}
.card-pf-icon-image {
height: 18px;
margin: 0 5px 5px;
}

.trend-card-large-pf {
.trend-header-pf {
display: block;
font-size: 16px;
font-weight: 400;
margin-left: 10px;
}
.trend-title-big-pf {
font-size: 26px;
font-weight: 300;
margin-left: 10px;
}
.trend-title-small-pf {
font-size: 12px;
font-weight: 400;
}
}
.trend-card-small-pf {
.trend-header-pf {
display: block;
font-size: 12px;
font-weight: 400;
margin-left: 10px;
}
.trend-title-big-pf {
font-size: 17px;
font-weight: 400;
margin-left: 10px;
}
.trend-title-small-pf {
font-size: 10px;
font-weight: 400;
}
}
188 changes: 188 additions & 0 deletions src/charts/charts.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
pf-c3-chart {
display: block;
}
.empty-chart-content {
text-align: center;
.pficon {
font-size: 24px;
}
span {
vertical-align: middle;
width: @width6;
}
}
.utilization-trend-chart-pf {
.donut-chart-pf {
float: left;
padding-top: 15px;
width: @width6;
}
h3 {
font-weight: 400;
}
.current-values {
border-bottom: 1px solid @color2;
float: left;
padding: 0 5px 10px 0;
width: @width6;
}
.available-count {
margin: 3px 0;
padding-left: 0;
padding-right: 5px;
}
.available-text {
font-size: 12px;
font-weight: 400;
line-height: 14px;
margin: 2px 0;
padding: 0 5px;
}
.radial-chart {
float: left;
padding-top: 10px;
width: @width6;
}
.sparkline-chart {
float: left;
margin-left: -5px;
margin-right: -5px;
width: @width6;
}
.legend-text {
color: inherit;
display: block;
font-size: 12px;
font-weight: 400;
margin-left: 0;
}
}
.utilization-trend-chart-pf.data-unavailable-pf {
.current-values {
color: transparent;
}
}

.trend-flat-details {
display: table;
margin-top: 5px;
}

@media (min-width: 768px) {
.trend-flat-details {
margin-top: 25px;
}
}

.trend-flat-details-cell {
display: table-cell;
min-width: 70px;
vertical-align: bottom;
}
.trend-header-compact-pf {
display: block;
font-size: 12px;
font-weight: 400;
}
.trend-title-compact-big-pf {
font-size: 36px;
font-weight: 300;
line-height: 1;
}
.trend-title-compact-small-pf {
font-size: 12px;
font-weight: 400;
}
.trend-title-flat-big-pf {
font-size: 26px;
font-weight: 300;
line-height: 1;
margin-right: 15px;
}
.trend-label-flat-pf {
font-size: 12px;
font-weight: 400;
line-height: 1;
}
.trend-label-flat-strong-pf {
display: block;
font-size: 12px;
font-weight: 700;
line-height: 1;
}
.trend-footer-pf {
color: #333333;
font-size: 10px;
font-weight: 400;
margin-left: 10px;
}

.data-unavailable-pf[class*="trend-title-"] {
color: transparent;
}
.data-unavailable-pf[class*="trend-label-"] {
color: transparent;
}
.data-unavailable-pf {
.trend-footer-pf {
color: transparent;
}
}

.utilization-bar-chart-pf {
.progress-bar {
-moz-transition: width .75s ease-in-out;
-o-transition: width .75s ease-in-out;
-webkit-transition: width .75s ease-in-out;
transition: width .75s ease-in-out;
}
.progress-bar.animate {
width: 0% !important;
}
}
.heatmap-pf-container {
position: relative;
.heatmap-container {
margin-left: -1px;
}
}
.heatmap-pf-container-pf {
.loading {
position: absolute;
right: 50%;
top: 100px;
z-index: 10;
}
}
.heatmap-pf-svg {
height: @height2;
width: @width6;
}
.heatmap-pf-legend-container {
list-style-type: none;
margin-top: 5px;
overflow: auto;
padding: 0;
}
.heatmap-pf-legend-items {
float: left;
}
.legend-pf-color-box {
display: inline-block;
height: 11px;
margin-left: 5px;
margin-right: 5px;
width: 11px;
&:first-of-type {
margin-left: 0px;
}
}
.legend-pf-text {
font-size: 11px;
font-weight: 400;
line-height: 11px;
padding-right: 5px;
}
.camelcase {
text-transform: capitalize;
}
30 changes: 30 additions & 0 deletions src/filters/filters.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.filter-pf {
a {
cursor: pointer;
}
}
.filter-pf.filter-fields {
.form-group {
padding-left: 0;
width: 275px;
}
}
.filter-select {
.btn-default {
background-color: @color0;
background-image: none;
color: @color1;
font-size: 12px;
font-style: italic;
font-weight: 400;
}
}
.input-group {
.input-group-btn {
.dropdown-menu>.selected>a {
background-color: @color5 !important;
border-color: #0076b7 !important;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to be from the patternfly color palette, should it be?

color: @color0 !important;
}
}
}
8 changes: 8 additions & 0 deletions src/notification/notification.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.toast-pf-action>a {
cursor: pointer;
}
.toast-pf {
.dropdown-menu>li>a {
cursor: pointer;
}
}
12 changes: 12 additions & 0 deletions src/sort/sort.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.sort-pf {
.btn-link {
color: #252525;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a palette color if possible

font-size: 16px;
line-height: 1;
margin-left: 10px;
padding: 4px 0;
&:hover {
color: @color5;
}
}
}
Loading