Skip to content

Commit

Permalink
[2375] Add primer and base less styles
Browse files Browse the repository at this point in the history
The primer is essentially a set of unit tests for the CSS, they currently
include base styles for elements as well as various combinations of
module. They can be viewed by visiting /base/test/primer/index.html
in the browser.
  • Loading branch information
aron committed May 8, 2012
1 parent 3125732 commit 742a5e7
Show file tree
Hide file tree
Showing 6 changed files with 558 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ckan/public/base/less/ckan.less
@@ -0,0 +1,7 @@
@import "variables.less";
@import "module.less";
@import "nav.less";

body {
background: @layout-background-color;
}
2 changes: 2 additions & 0 deletions ckan/public/base/less/main.less
@@ -0,0 +1,2 @@
@import "./vendor/bootstrap/bootstrap.less";
@import "./ckan.less";
32 changes: 32 additions & 0 deletions ckan/public/base/less/module.less
@@ -0,0 +1,32 @@
// Local Variables
@module-margin-x: 25px;
@module-margin-y: 20px;

.module {
.border-radius(3px);
.box-shadow(0 0 3px rgba(0, 0, 0, 0.3));

background-color: @module-background-color;
margin-bottom: 10px;
}

.module .heading {
font-size: 14px;
padding: 0 @module-margin-x;
border-bottom: 1px solid @module-heading-border-color;
#gradient > .vertical(@module-heading-background-color-start, @module-heading-background-color-end);
}

.module .content {
padding: @module-margin-y @module-margin-x;
}

.module .content :last-child {
margin-bottom: 0;
}

.module .content .heading {
.module .heading;
margin: 20px -@module-margin-x 20px;
border-top: 1px solid lighten(@module-heading-border-color, 5%);
}
28 changes: 28 additions & 0 deletions ckan/public/base/less/nav.less
@@ -0,0 +1,28 @@
.nav-simple {
.clearfix();
padding-bottom: 7px;
}

.nav-simple > li {
border-bottom: 1px dotted #ccc;
}

.nav-simple > li > a {
color: @nav-link-color;
padding: 10px 20px;
line-height: 14px; // keeps the overall height an even number
}

.nav-simple > li.selected > a {
@inner-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.35);
@outer-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
.border-radius(3px);
.box-shadow(@inner-shadow);
box-shadow: @inner-shadow, @outer-shadow;
cursor: default;
margin: 2px 5px 3px;
padding: 8px 13px;
background: #000;
color: #fff;
border: 1px solid black;
}
20 changes: 20 additions & 0 deletions ckan/public/base/less/variables.less
@@ -0,0 +1,20 @@
// Base variables
@font-family: Arial, sans-serif;
@image-path: "../images";

// Layout Variables
@layout-background-color: #f2f1ee;

// Module Variables
@module-background-color: #fff;
@module-heading-border-color: #d0d0d0;
@module-heading-background-color-start: #f5f5f5;
@module-heading-background-color-end: #f0f0f0;

@nav-link-color: #333;

// Twitter Bootstrap Overrides
@baseFontFamily: @font-family;
@iconSpritePath: "@{image-path}/bootstrap-glyphicons-halflings.png";
@iconWhiteSpritePath: "@{image-path}/bootstrap-glyphicons-halflings-white.png";

0 comments on commit 742a5e7

Please sign in to comment.