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 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
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
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,39 @@ Note:
<script src="node_modules/angular-patternfly/node_modules/patternfly/node_modules/c3/c3.min.js"></script>
<script src="node_modules/angular-patternfly/node_modules/patternfly/node_modules/d3/d3.min.js"></script>

5. (optional) The 'patternfly.charts' and 'patternfly.table' modules are not dependencies in the default angular 'patternfly' module.
In order to use patternfly charts and/or patternfly.table, you must add them as dependencies in your application:
5. (optional) The 'patternfly.charts' module is not a dependency in the default angular 'patternfly' module.
In order to use patternfly charts you must add it as a dependency in your application:

my-app.module.js:

angular.module('myApp', [
'patternfly',
'patternfly.charts'
]);

6. (optional) The 'patternfly.table' module is not a dependency in the default angular 'patternfly' module.
In order to use pfTableView, you must add 'patternfly.table' as a dependency in your application:

my-app.module.js:

angular.module('myApp', [
'patternfly',
'patternfly.charts',
'patternfly.table'
]);

Add the following CSS includes to your HTML file(s):

<!-- Place before any patternfly css -->
<link rel="stylesheet" href="node_modules/datatables.net-dt/css/jquery.dataTables.css" />

Add the following Javascript includes to your HTML file(s):

<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/datatables.net/js/jquery.dataTables.js"></script>
<script src="node_modules/datatables.net-select/js/dataTables.select.js"></script>
<script src="node_modules/angular-datatables/dist/angular-datatables.min.js"></script>
<script src="node_modules/angular-datatables/dist/plugins/select/angular-datatables.select.min.js"></script>

### Using with Webpack

In order to use Angular-Patternfly in a Webpack-bundled application there are some things you need to keep in mind:
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: 100%;
}
}
.utilization-trend-chart-pf {
.donut-chart-pf {
float: left;
padding-top: 15px;
width: 100%;
}
h3 {
font-weight: 400;
}
.current-values {
border-bottom: 1px solid @color-pf-black-300;
float: left;
padding: 0 5px 10px 0;
width: 100%;
}
.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: 100%;
}
.sparkline-chart {
float: left;
margin-left: -5px;
margin-right: -5px;
width: 100%;
}
.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: 100%;
width: 100%;
}
.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;
}
Loading