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

Conversation

dtaylor113
Copy link
Member

@dtaylor113 dtaylor113 commented Jan 25, 2017

Replaced the rather large 'styles/angular-patternfly.css' with 'styles/angular-patternfly.less' (which contains all the @imports) and created several .less files in various component sub-directories.

This is In preparation of contributing the 'Canvas Drag & Drop' component from SUI to angular-patternfly. This new component does not exist in patternfly base ref. so the accompanying styles need to live in angular-patternfly until such time we decide to contribute it back to base patternfly. Base patternfly already uses .less, so this makes a future contribution easier.

Also updated the README with setup instructions for pfTableView

Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

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

Great change for sure. Overall looks good.

In general, I think we need to move most of these settings into patternfly (as a separate PR). Maybe get a story in the backlog to do so.

});

// 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

@@ -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)

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

.input-group-btn {
.dropdown-menu>.selected>a {
background-color: @color-pf-blue !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?

@@ -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

@width100: 100%;
@width0: 0;
@height100: 100%;
@height0: 0;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure these are worth having. Honestly, while reviewing I thought @width100 would be 100px so at minimum it is a bit confusing.

@dtaylor113
Copy link
Member Author

Hi Jeff, I'm sorry, but I don't have time to address these already-existing style issues. This PR was just a step in the right direction, and to pave the way for the pfCanvas contribution I'm making -which I'm trying to get done by Monday :-)
I created a story PTNFLY-2138 to further get a-pf in parity with base pf. I will add a link to your review comments here.

Is that ok?

Thanks,

  • Dave

@jeff-phillips-18
Copy link
Member

@dtaylor113 That is fine. These issues, while they 'existed', were not able to be done correctly prior to using less because the variables are not available in css.

Could we just get rid of the variables.less file and use those values straight up?
A) I can't imagine 0 or 100 ever not being 0 or 100 so its not like it reduces changes in the future
B) width100 and height100 are unclear.

@dtaylor113
Copy link
Member Author

Ok, no prob, I'll remove the varibles.less file :-)

Copy link
Member

@jeff-phillips-18 jeff-phillips-18 left a comment

Choose a reason for hiding this comment

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

👍

@jeff-phillips-18 jeff-phillips-18 merged commit 80e950a into patternfly:branch-4.0-dev Jan 26, 2017
@dtaylor113 dtaylor113 deleted the less branch April 20, 2017 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants