Permalink
Browse files

Updating Horizon to use LESS.

This changes all of the Bootstrap CSS and Horizon
CSS to use LESS. Horizon's specific CSS will be
organized into separate files in another commit,
as it is outside the scope of this BP.

We are also now packing LESS 1.3.0 directly within
Horizon.

Implementation of Blueprint transition-to-lesscss

Change-Id: Ie4be8b28ab3ce04ea21d7d5cd49c2ccb66bd8ade
  • Loading branch information...
JohnPostlethwait committed May 12, 2012
1 parent 187785b commit 0074328fbbac6967d5dda2f3b0f3f98a91d17a01
Showing with 8,399 additions and 4,731 deletions.
  1. +2 −0 .gitignore
  2. +16 −0 README.rst
  3. +139 −0 bin/less/lessc
  4. +380 −0 bin/lib/less/browser.js
  5. +152 −0 bin/lib/less/colors.js
  6. +355 −0 bin/lib/less/cssmin.js
  7. +228 −0 bin/lib/less/functions.js
  8. +148 −0 bin/lib/less/index.js
  9. +1,334 −0 bin/lib/less/parser.js
  10. +62 −0 bin/lib/less/rhino.js
  11. +17 −0 bin/lib/less/tree.js
  12. +17 −0 bin/lib/less/tree/alpha.js
  13. +13 −0 bin/lib/less/tree/anonymous.js
  14. +17 −0 bin/lib/less/tree/assignment.js
  15. +48 −0 bin/lib/less/tree/call.js
  16. +101 −0 bin/lib/less/tree/color.js
  17. +14 −0 bin/lib/less/tree/comment.js
  18. +42 −0 bin/lib/less/tree/condition.js
  19. +49 −0 bin/lib/less/tree/dimension.js
  20. +35 −0 bin/lib/less/tree/directive.js
  21. +52 −0 bin/lib/less/tree/element.js
  22. +23 −0 bin/lib/less/tree/expression.js
  23. +83 −0 bin/lib/less/tree/import.js
  24. +51 −0 bin/lib/less/tree/javascript.js
  25. +19 −0 bin/lib/less/tree/keyword.js
  26. +114 −0 bin/lib/less/tree/media.js
  27. +146 −0 bin/lib/less/tree/mixin.js
  28. +32 −0 bin/lib/less/tree/operation.js
  29. +16 −0 bin/lib/less/tree/paren.js
  30. +29 −0 bin/lib/less/tree/quoted.js
  31. +42 −0 bin/lib/less/tree/rule.js
  32. +225 −0 bin/lib/less/tree/ruleset.js
  33. +42 −0 bin/lib/less/tree/selector.js
  34. +25 −0 bin/lib/less/tree/url.js
  35. +24 −0 bin/lib/less/tree/value.js
  36. +26 −0 bin/lib/less/tree/variable.js
  37. +18 −2 openstack_dashboard/settings.py
  38. +0 −581 openstack_dashboard/static/bootstrap/css/bootstrap-responsive.css
  39. +0 −4 openstack_dashboard/static/bootstrap/css/bootstrap-responsive.min.css
  40. +0 −3,496 openstack_dashboard/static/bootstrap/css/bootstrap.css
  41. +0 −632 openstack_dashboard/static/bootstrap/css/bootstrap.min.css
  42. +28 −0 openstack_dashboard/static/bootstrap/less/accordion.less
  43. +70 −0 openstack_dashboard/static/bootstrap/less/alerts.less
  44. +62 −0 openstack_dashboard/static/bootstrap/less/bootstrap.less
  45. +22 −0 openstack_dashboard/static/bootstrap/less/breadcrumbs.less
  46. +148 −0 openstack_dashboard/static/bootstrap/less/button-groups.less
  47. +183 −0 openstack_dashboard/static/bootstrap/less/buttons.less
  48. +121 −0 openstack_dashboard/static/bootstrap/less/carousel.less
  49. +18 −0 openstack_dashboard/static/bootstrap/less/close.less
  50. +57 −0 openstack_dashboard/static/bootstrap/less/code.less
  51. +18 −0 openstack_dashboard/static/bootstrap/less/component-animations.less
  52. +130 −0 openstack_dashboard/static/bootstrap/less/dropdowns.less
  53. +522 −0 openstack_dashboard/static/bootstrap/less/forms.less
  54. +8 −0 openstack_dashboard/static/bootstrap/less/grid.less
  55. +20 −0 openstack_dashboard/static/bootstrap/less/hero-unit.less
  56. +32 −0 openstack_dashboard/static/bootstrap/less/labels.less
  57. +17 −0 openstack_dashboard/static/bootstrap/less/layouts.less
  58. +590 −0 openstack_dashboard/static/bootstrap/less/mixins.less
  59. +83 −0 openstack_dashboard/static/bootstrap/less/modals.less
  60. +299 −0 openstack_dashboard/static/bootstrap/less/navbar.less
  61. +353 −0 openstack_dashboard/static/bootstrap/less/navs.less
  62. +30 −0 openstack_dashboard/static/bootstrap/less/pager.less
  63. +55 −0 openstack_dashboard/static/bootstrap/less/pagination.less
  64. +49 −0 openstack_dashboard/static/bootstrap/less/popovers.less
  65. +95 −0 openstack_dashboard/static/bootstrap/less/progress-bars.less
  66. +126 −0 openstack_dashboard/static/bootstrap/less/reset.less
  67. +327 −0 openstack_dashboard/static/bootstrap/less/responsive.less
  68. +29 −0 openstack_dashboard/static/bootstrap/less/scaffolding.less
  69. +158 −0 openstack_dashboard/static/bootstrap/less/sprites.less
  70. +150 −0 openstack_dashboard/static/bootstrap/less/tables.less
  71. +35 −0 openstack_dashboard/static/bootstrap/less/thumbnails.less
  72. +35 −0 openstack_dashboard/static/bootstrap/less/tooltip.less
  73. +222 −0 openstack_dashboard/static/bootstrap/less/type.less
  74. +23 −0 openstack_dashboard/static/bootstrap/less/utilities.less
  75. +107 −0 openstack_dashboard/static/bootstrap/less/variables.less
  76. +17 −0 openstack_dashboard/static/bootstrap/less/wells.less
  77. +17 −12 openstack_dashboard/static/dashboard/{css/style.css → less/horizon.less}
  78. +6 −4 openstack_dashboard/templates/_stylesheets.html
  79. +1 −0 tools/pip-requires
View
@@ -4,6 +4,7 @@
.selenium_log
.coverage*
.noseids
+.DS_STORE
coverage.xml
nosetests.xml
pep8.txt
@@ -13,6 +14,7 @@ horizon.egg-info
openstack_dashboard/local/local_settings.py
docs/build/
docs/source/sourcecode
+/static/
.venv
.tox
build
View
@@ -20,6 +20,22 @@ For issue tracking:
* https://bugs.launchpad.net/horizon
+Dependencies
+============
+
+To get started you will need to install Node.js (http://nodejs.org/) on your
+machine. Node.js is used with Horizon in order to use LESS
+(http://lesscss.org/) for our CSS needs. Horizon is currently using Node.js
+v0.6.12.
+
+For Ubuntu use apt to install Node.js::
+
+ $ sudo apt-get install nodejs
+
+For other versions of Linux, please see here:: http://nodejs.org/#download for
+how to install Node.js on your system.
+
+
Getting Started
===============
View
@@ -0,0 +1,139 @@
+#!/usr/bin/env node
+
+var path = require('path'),
+ fs = require('fs'),
+ sys = require('util'),
+ os = require('os');
+
+var less = require('../lib/less');
+var args = process.argv.slice(1);
+var options = {
+ compress: false,
+ yuicompress: false,
+ optimization: 1,
+ silent: false,
+ paths: [],
+ color: true,
+ strictImports: false
+};
+
+args = args.filter(function (arg) {
+ var match;
+
+ if (match = arg.match(/^-I(.+)$/)) {
+ options.paths.push(match[1]);
+ return false;
+ }
+
+ if (match = arg.match(/^--?([a-z][0-9a-z-]*)(?:=([^\s]+))?$/i)) { arg = match[1] }
+ else { return arg }
+
+ switch (arg) {
+ case 'v':
+ case 'version':
+ sys.puts("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]");
+ process.exit(0);
+ case 'verbose':
+ options.verbose = true;
+ break;
+ case 's':
+ case 'silent':
+ options.silent = true;
+ break;
+ case 'strict-imports':
+ options.strictImports = true;
+ break;
+ case 'h':
+ case 'help':
+ sys.puts("usage: lessc source [destination]");
+ process.exit(0);
+ case 'x':
+ case 'compress':
+ options.compress = true;
+ break;
+ case 'yui-compress':
+ options.yuicompress = true;
+ break;
+ case 'no-color':
+ options.color = false;
+ break;
+ case 'include-path':
+ options.paths = match[2].split(os.type().match(/Windows/) ? ';' : ':')
+ .map(function(p) {
+ if (p) {
+ return path.resolve(process.cwd(), p);
+ }
+ });
+ break;
+ case 'O0': options.optimization = 0; break;
+ case 'O1': options.optimization = 1; break;
+ case 'O2': options.optimization = 2; break;
+ }
+});
+
+var input = args[1];
+if (input && input != '-') {
+ input = path.resolve(process.cwd(), input);
+}
+var output = args[2];
+if (output) {
+ output = path.resolve(process.cwd(), output);
+}
+
+var css, fd, tree;
+
+if (! input) {
+ sys.puts("lessc: no input files");
+ process.exit(1);
+}
+
+var parseLessFile = function (e, data) {
+ if (e) {
+ sys.puts("lessc: " + e.message);
+ process.exit(1);
+ }
+
+ new(less.Parser)({
+ paths: [path.dirname(input)].concat(options.paths),
+ optimization: options.optimization,
+ filename: input,
+ strictImports: options.strictImports
+ }).parse(data, function (err, tree) {
+ if (err) {
+ less.writeError(err, options);
+ process.exit(1);
+ } else {
+ try {
+ css = tree.toCSS({
+ compress: options.compress,
+ yuicompress: options.yuicompress
+ });
+ if (output) {
+ fd = fs.openSync(output, "w");
+ fs.writeSync(fd, css, 0, "utf8");
+ } else {
+ sys.print(css);
+ }
+ } catch (e) {
+ less.writeError(e, options);
+ process.exit(2);
+ }
+ }
+ });
+};
+
+if (input != '-') {
+ fs.readFile(input, 'utf-8', parseLessFile);
+} else {
+ process.stdin.resume();
+ process.stdin.setEncoding('utf8');
+
+ var buffer = '';
+ process.stdin.on('data', function(data) {
+ buffer += data;
+ });
+
+ process.stdin.on('end', function() {
+ parseLessFile(false, buffer);
+ });
+}
Oops, something went wrong.

0 comments on commit 0074328

Please sign in to comment.