Skip to content

Commit

Permalink
[2375] Add an icons.less file
Browse files Browse the repository at this point in the history
This contains all the styles for the inline icons. They can be used in
the same way as the Bootstrap ones but use the .ckan-icon class instead.
  • Loading branch information
aron committed May 17, 2012
1 parent d504963 commit 860fc25
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions ckan/public/base/less/ckan.less
Expand Up @@ -5,6 +5,7 @@
@import "dataset.less";
@import "toolbar.less";
@import "prose.less";
@import "icons.less";
@import "layout.less";
@import "masthead.less";
@import "footer.less";
Expand Down
52 changes: 52 additions & 0 deletions ckan/public/base/less/icons.less
@@ -0,0 +1,52 @@
@small-x: 16px;
@small-y: 16px;
@medium-x: 17px;
@medium-y: 17px;
@medium-offset-y: -@small-y;
@large-x: 20px;
@large-y: 20px;
@large-offset-x: -20px;
@large-offset-y: -(@small-y + @medium-y);

.ckan-icon {
.ie7-restore-right-whitespace;
display: inline-block;
vertical-align: text-bottom;
position: relative;
top: 2px;
width: 16px;
height: 16px;
background-image: url("@{image-path}/sprite-ckan-icons.png");
background-repeat: no-repeat;
background-position: 16px 16px;
}

.ckan-icon-medium {
width: @medium-x;
height: @medium-y;
}

.ckan-icon-large {
width: @large-x;
height: @large-y;
}

.ckan-icon-background-position(@offset, @size) {
@w: "@{size}-x";
@h: "@{size}-y";
@x: "@{size}-offset-x";
@y: "@{size}-offset-y";
width: @@w;
height: @@h;
background-position: (@@x * @offset) @@y;
}

.ckan-icon-lock { .ckan-icon-background-position(0, "large") }
.ckan-icon-photo { .ckan-icon-background-position(1, "large") }
.ckan-icon-add { .ckan-icon-background-position(2, "large") }
.ckan-icon-home { .ckan-icon-background-position(3, "large") }
.ckan-icon-rewind { .ckan-icon-background-position(4, "large") }
.ckan-icon-tools { .ckan-icon-background-position(5, "large") }
.ckan-icon-flag { .ckan-icon-background-position(6, "large") }
.ckan-icon-clipboard { .ckan-icon-background-position(7, "large") }
.ckan-icon-share { .ckan-icon-background-position(8, "large") }

0 comments on commit 860fc25

Please sign in to comment.