Skip to content

Commit

Permalink
cleanup global import to skip icons unless requested. misc css fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brentkirby committed Jun 4, 2012
1 parent 124a799 commit 0691352
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
4 changes: 3 additions & 1 deletion lib/facades/helpers/navigation.rb
Expand Up @@ -19,11 +19,13 @@ def nav(options = {}, &block)
#
def nav_link(text, href, options = {})
options.merge!(:path => request.path)
wrapper = options.delete(:wrapper)

link = NavigationLink.new(text, href, options)
if link.active?
link.options = Navigator.merge_html_classes('active', link.options)
end
if wrapper = options.delete(:wrapper)
if wrapper
if wrapper.is_a?(Hash)
wrap_attrs = wrapper
wrapper = :li
Expand Down
6 changes: 5 additions & 1 deletion lib/facades/sass_extensions/icons.rb
Expand Up @@ -22,13 +22,17 @@ def icon_glyph(name, use_entity = false)

def icon_names(set = "ui")
listing = icon_translations(set)
Sass::Script::List.new((listing.keys || []))
keys = (listing.keys || [])
keys = keys.collect{ |k| Sass::Script::String.new(k) }
Sass::Script::List.new(keys, ',')
end

private

def icon_translations(set = "ui")
set = set.value if set.respond_to?(:value)
glyphs = Icons.glyph_sets[set] || YAML::load(File.open(File.join(Facades.image_path, 'icons', set, 'icons.yml')))
puts glyphs.inspect
Icons.glyph_sets[set] ||= Hash[glyphs.map{ |k, v| [k.to_s.gsub("_", "-"), v] }]
Icons.glyph_sets[set]
end
Expand Down
11 changes: 0 additions & 11 deletions src/scss/facades/_global.scss
Expand Up @@ -16,7 +16,6 @@
@import 'facades/patterns/pills';
@import 'facades/patterns/twipsy';
@import 'facades/buttons';
@import 'facades/icons';

$facades-global-import-used: true;

Expand Down Expand Up @@ -78,16 +77,6 @@ html.lt-ie8{
}
}

@include icon-classes;

.icon-16{ @include icon-rect(16px); }
.icon-32{ @include icon-rect(32px); }
.icon-24{ @include icon-rect(24px); }

[class^="icon-"], [class*=" icon-"] {
display: inline; width: auto; height: auto; line-height: inherit; vertical-align: baseline;
}

form{
@include form;

Expand Down
5 changes: 5 additions & 0 deletions src/scss/facades/_mixins.scss
Expand Up @@ -67,6 +67,11 @@ $experimental-support-for-khtml: false !default;
}
}

@mixin user-select($val: "none"){
@include experimental("user-select", unquote($val), -moz, -webkit, -khtml, -ms, official);
@include experimental("touch-callout", unquote($val), -webkit, official, not -moz, not -khtml, not -ms);
}

//
// Clip properties
// Creates a clip rect, including IE specific version.
Expand Down
12 changes: 12 additions & 0 deletions src/scss/facades/icons/_classes.scss
Expand Up @@ -28,4 +28,16 @@
font-size: 1.3333333333333333em;
}

[class^="#{$prefix}"], [class*=" #{$prefix}"] {
display: inline; width: auto; height: auto; line-height: inherit; vertical-align: baseline;
}



}

@mixin icon-rect-classes{
.icon-16{ @include icon-rect(16px); }
.icon-32{ @include icon-rect(32px); }
.icon-24{ @include icon-rect(24px); }
}
1 change: 1 addition & 0 deletions src/scss/facades/layout/_lists.scss
Expand Up @@ -29,6 +29,7 @@
@mixin floated-list{
list-style:none;
display:block;
margin-left:0;

li{
display:block;
Expand Down

0 comments on commit 0691352

Please sign in to comment.