Skip to content
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

Remove dev styling from compiled css and update pipeline #560

Merged
merged 8 commits into from
Mar 1, 2018

Conversation

kr8n3r
Copy link

@kr8n3r kr8n3r commented Feb 28, 2018

We don't want dev specific css in compiled output in dist, as observed in user research.
This PR addresses this by:

  • creating separate app only sass entry points where $mq-show-breakpoints is included
  • updates app layout template to reference app*.css files
  • modifying scss:compile task to use either app*.scss or govuk-frontend*.scss files as source for compilation
  • adding test to check for presence of that string in compiled stylesheets

Additionally:

  • removes magic commenting with gulp-replace and gulp-replaces from dependencies
  • adds a file helper function to read contents of a file for a given path

the flow is now as follows:

  • if dev then compile app*.scss with mq-show-breapointsand anthing else we might want to include in teh review app
  • if dist then compile govuk-frontend*.scss without mq-show-breakpoints

This should also address #556

https://trello.com/c/woTnvOTx/801-remove-active-breakpoint-debug-helper-from-dist-css

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-560 February 28, 2018 21:42 Inactive
@@ -0,0 +1,5 @@
// If you want to display the currently active breakpoint in the top
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason these aren't using the existing app stylesheets, which are now not being used?

Copy link
Author

@kr8n3r kr8n3r Mar 1, 2018

Choose a reason for hiding this comment

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

the task to compile css for dist and review app is the same. tried using the same entry point for both and couldn't find a way to not include breakpoints in dist compiled and include them in review compiled
we might also want to add and more styles currently in views into app*.scss

Copy link
Author

@kr8n3r kr8n3r Mar 1, 2018

Choose a reason for hiding this comment

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

govuk-frontend*.scss files are used for compilation to dist

Copy link
Member

Choose a reason for hiding this comment

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

The govuk-frontend*.scss files in the app folder are used for compilation to dist?

Copy link
Author

Choose a reason for hiding this comment

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

yes. happy to find a better place for them.
they used to be in globals and we were filtering them from copy task.

@@ -31,9 +30,20 @@ const errorHandler = function (error) {
this.once('finish', () => process.exit(1))
this.emit('end')
}
// used only for review app as they include showing of media queries
Copy link
Member

Choose a reason for hiding this comment

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

The existing app assets seem to be getting compiled OK, so not sure why this is needed.

@@ -54,42 +64,6 @@ gulp.task('scss:compile', () => {
})
))
.pipe(gulp.dest(taskArguments.destination + '/css/'))

let compileOldIe = gulp.src(configPaths.app + 'assets/scss/govuk-frontend-old-ie.scss')
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why this is being removed as part of this PR. Don't we still need an old-ie stylesheet?

Copy link
Author

@kr8n3r kr8n3r Mar 1, 2018

Choose a reason for hiding this comment

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

we still have old ie stylesheet. oldie was not doing anything that we don't currently do already: (flatten mq's, use rems)

Copy link
Member

Choose a reason for hiding this comment

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

Can that change be made in a separate PR? It doesn't seem related to the other changes.

(I think there are some things oldie might be doing or should be doing – patching ::before into :before (which is currently disabled??), changing opacity to filters – but I don't want to hold this PR up)

Copy link
Author

Choose a reason for hiding this comment

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

ok, can leave it in and will add required merge-stream back in


// Read the contents of a file from a given path
const readFileContents = filePath => {
const contents = fs.readFileSync(filePath, 'utf8')
Copy link
Member

Choose a reason for hiding this comment

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

Can just return fs.readFileSync(filePath, 'utf8')

Copy link
Author

Choose a reason for hiding this comment

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

yeah could do

@kr8n3r kr8n3r force-pushed the remove-dev-styling-from-compiled-css branch from 0eb3072 to 95cbdc8 Compare March 1, 2018 09:16
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-560 March 1, 2018 09:16 Inactive
@kr8n3r kr8n3r force-pushed the remove-dev-styling-from-compiled-css branch from 95cbdc8 to eb6d56b Compare March 1, 2018 11:05
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-560 March 1, 2018 11:05 Inactive
@kr8n3r
Copy link
Author

kr8n3r commented Mar 1, 2018

reverted removing oldie compilation

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-review-pr-560 March 1, 2018 11:16 Inactive
@kr8n3r
Copy link
Author

kr8n3r commented Mar 1, 2018

@36degrees forgot to add changelog. still ok with it?

@36degrees
Copy link
Member

LGTM.

@kr8n3r kr8n3r merged commit eb936e9 into master Mar 1, 2018
@kr8n3r kr8n3r deleted the remove-dev-styling-from-compiled-css branch March 1, 2018 11:37
This was referenced Mar 1, 2018
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.

None yet

3 participants