Ticket #2951 (new enhancement)

Opened 19 months ago

Last modified 19 months ago

Paster command for building css from less

Reported by: icmurray Owned by:
Priority: minor Milestone: ckan 2.0
Component: ckan Keywords:
Cc: Repository: ckan
Theme: none

Description (last modified by icmurray) (diff)

With the latest template, css and js changes in 2.0, there are a number of things that need preparation prior to a production deployment. One of these is:

  • the less files should be compiled to css (main.css, not just main.debug.css)

This ticket is to provide a paster command which will compile the .less into the main.css file. The idea of the paster command is that it will be run by developers, and they will check in the resulting .css files. It will also provide a convenient mechanism for production scenarios with node.js installed on the production server, as they will be able to compile the .less there as well.

## Background

The .css files that need to be served are built using less. The css files that are generated *are* checked-in to the repo; but they are a build artifact. So the general workflow is:

  • commit changes to the less files
  • build the main.css file and commit

This paster command slots into the above workflow for convenience.

## Notes

  • doc/frontend-development.rst
  • bin/less

to run this paster command, Node will be required. So that dependency should be checked.

## The paster command

This is the proposed behaviour of the paster command:

  • ensure custom.less does not exist
  • for each colour in{fuchsia,green,maroon,red}:
    • generate a custom.less file for $colour. There's a paster command that does this already: `paster color <color name>.
    • generate the css from the less files. ie - the equivelant of running bin/less --production.
      • this will generate a main.css file, which should be renamed to $color.css.
  • ensure custom.less does not exist
  • generate the css from the less files. This will create a main.css with the default colour scheme.
  • call the paster command that minifies css and js files. (This command does not exist yet, see #2950)

Change History

comment:1 Changed 19 months ago by toby

the files like red.css should also be done as part of this. and before minification of files - should really be part of same process

comment:2 Changed 19 months ago by icmurray

  • Description modified (diff)
Note: See TracTickets for help on using tickets.