Skip to content

Commit

Permalink
fixing 3.2 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
eoneill committed Apr 29, 2014
1 parent 5cbd9cf commit cd1d610
Show file tree
Hide file tree
Showing 22 changed files with 204 additions and 263 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -10,5 +10,4 @@ unless ENV["CI"]
gem 'sassdoc'
gem 'rdoc'
gem 'colorize'
gem 'fileutils'
end
6 changes: 0 additions & 6 deletions VERSION.yml

This file was deleted.

6 changes: 3 additions & 3 deletions archetype.gemspec
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |gemspec|

# Gem Files
gemspec.executables = %w(archetype)
gemspec.files = %w(LICENSE README.md CHANGELOG.md VERSION.yml)
gemspec.files = %w(LICENSE README.md CHANGELOG.md)
gemspec.files += Dir.glob("bin/*")
gemspec.files += Dir.glob("lib/**/*")
gemspec.files += Dir.glob("stylesheets/**/*")
Expand All @@ -34,8 +34,8 @@ Gem::Specification.new do |gemspec|
## Gem Bookkeeping
gemspec.rubygems_version = %q{1.3.6}
# dependencies
gemspec.add_dependency('compass')
gemspec.add_dependency('sass')
gemspec.add_dependency('sass', '>= 3.2', '< 3.3')
gemspec.add_dependency('compass', '>= 0.12', '< 1.0')
# required for OrderedHash on Ruby < 1.9
gemspec.add_dependency('hashery')
end
10 changes: 0 additions & 10 deletions lib/archetype/functions/helpers.rb
Expand Up @@ -60,16 +60,6 @@ def self.list_to_hash(list, depth = 0, nest = [], additives = [])
list.each do |item|
item = item.to_a

# if a 3rd item exists, we probably forgot a comma or parens somewhere
if previous.nil? and not item[2].nil?
msg = "you're likely missing a comma or parens in your data structure"
begin
logger.record(:warning, "#{msg}: #{item}")
rescue
logger.record(:warning, msg)
end
end

# convert the key to a string and strip off quotes
key = to_str(item[0], ' ' , :quotes)
# capture the value
Expand Down
Expand Up @@ -5,35 +5,7 @@ module Tree
module Visitors
class Perform
def handle_include_loop!(node)
# a list of exempt mixins
exempt = %w(to-styles output-style -outputStyle)
exempts = []

msg = "An @include loop has been found:"
content_count = 0
mixins = @stack.reverse.map {|s| s[:name]}.compact.select do |s|
if s == '@content'
content_count += 1
false
elsif content_count > 0
content_count -= 1
false
# if the mixin is exempt, keep track of it
elsif exempt.include?(s.gsub(/_/,'-'))
exempts.push(s)
false
else
true
end
end

return if mixins.empty? or (mixins.size <= exempts.size)
raise Sass::SyntaxError.new("#{msg} #{node.name} includes itself") if mixins.size == 1

msg << "\n" << Sass::Util.enum_cons(mixins.reverse + [node.name], 2).map do |m1, m2|
" #{m1} includes #{m2}"
end.join("\n")
raise Sass::SyntaxError.new(msg)
# do nothing
end
end
end
Expand Down
74 changes: 1 addition & 73 deletions lib/archetype/version.rb
@@ -1,75 +1,3 @@
module Archetype
module Version
#
# Returns a string representing the version.
#
# The :major, :minor, and :teeny keys have their respective numbers.
# The :string key contains a human-readable string representation of the version.
# The :rev key will have the current revision hash.
#
# Method borrowed from Compass. All credit goes to Chris Eppstein and other contributors
# https://github.com/chriseppstein/compass/blob/stable/lib/compass/version.rb
# \(This method swiped from Haml and then modified, some credit goes to Nathan Weizenbaum\)
#
# *Returns*:
# - {String} the version of Archetype
#
def version
if defined?(@version)
@version
else
read_version
end
end

protected
def scope(file) # :nodoc:
File.join(File.dirname(__FILE__), '..', '..', file)
end

def read_version
require 'yaml'
begin
@version = YAML.load(File.read(scope('VERSION.yml')))
@version[:teeny] = @version[:patch]
@version[:string] = "#{@version[:major]}.#{@version[:minor]}"
@version[:string] << ".#{@version[:patch]}" if @version[:patch]
@version[:string] << ".#{@version[:build]}" if @version[:build]
@version[:string] << ".#{@version[:state]}" if @version[:state]
@version[:string] << ".#{@version[:iteration]}" if @version[:iteration]
if !ENV['OFFICIAL'] && r = revision
@version[:string] << ".#{r[0..6]}"
@version[:rev] = r
end
return @version
rescue
# this is a hack, but I'm not fully understanding how to fix this correctly
# see issue #4
# if it failed, try again, for now
return read_version
end
end

def revision
revision_from_git
end

def revision_from_git
if File.exists?(scope('.git/HEAD'))
Dir.chdir scope(".") do
`git rev-parse HEAD`
end
end
end
end

extend Archetype::Version
def self.const_missing(const)
# This avoid reading from disk unless the VERSION is requested.
if const == :VERSION
version[:string]
else
super
end
end
VERSION = '0.0.1.pre.8'
end
6 changes: 5 additions & 1 deletion stylesheets/archetype/_config.scss
Expand Up @@ -326,13 +326,15 @@ $CORE_SAFE_FONTS: (
(ko_KR ('Malgun Gothic', default)),
(zh_TW (SimSun, default)),
(zh_CN (SimSun, default)),
(th_TH (Tahoma, default)),
(ar_AE (Tahoma, Arial, 'Times New Roman', default))
)),
(win, (
(default (Arial, sans-serif)),
(ja_JP (メイリオ, Meiryo, 'MS Pゴシック', 'MS PGothic', default)),
(zh_TW (default, '微軟正黑體', 'Microsoft JhengHei', PMingLiu, '宋体', SimSun)),
(zh_CN (default, '华文细黑', 'STHeiti Light', '微软雅黑体', 'Microsoft Yahei', '新宋体', NSimSun, '宋体', SimSun)),
(zh_CN (Arial, '华文细黑', 'STHeiti Light', '微软雅黑体', 'Microsoft Yahei', '新宋体', NSimSun, '宋体', SimSun)), // Heiti/Yahei not showing up in Chrome and FF in windows. Removal of sans-serif fixes it.
(th_TH nil),
(ko_KR nil),
(ar_AE nil)
)),
Expand All @@ -341,6 +343,7 @@ $CORE_SAFE_FONTS: (
(zh_TW (default, '黑體-繁', 'Heiti TC', '儷黑Pro', 'LiHei Pro', PMingLiu, '宋体', SimSun)),
(zh_CN (default, '黑体-简', 'Heiti SC', '华文细黑', 'STHeiti Light', '华文黑体', STHeiti)),
(ja_JP ('Hiragino Kaku Gothic Pro', 'ヒラギノ角ゴ Pro W3', 'MS Pゴシック', 'MS PGothic', default)),
(th_TH nil),
(ko_KR nil),
(ar_AE nil)
)),
Expand All @@ -349,6 +352,7 @@ $CORE_SAFE_FONTS: (
(zh_TW (default, PMingLiu, '宋体', SimSun)),
(zh_CN (default, '新宋体', NSimSun, '宋体', SimSun)),
(ja_JP nil),
(th_TH nil),
(ko_KR nil),
(ar_AE nil)
))
Expand Down
45 changes: 25 additions & 20 deletions stylesheets/archetype/_hacks.scss
Expand Up @@ -40,13 +40,8 @@
// @param $name {String} the name of the element
// @content
@mixin ie-pseudo-before($styles: false, $content: false, $name: '') {
@if archetype-version('Sass >= 3.2') {
@include ie-pseudo($styles, $content, before, $name) {
@content;
}
}
@else {
@include ie-pseudo($styles, $content, before, $name);
@include ie-pseudo($styles, $content, before, $name) {
@content;
}
}

Expand All @@ -57,17 +52,12 @@
// @param $name {String} the name of the element
// @content
@mixin ie-pseudo-after($styles: false, $content: false, $name: '') {
@if archetype-version('Sass >= 3.2') {
@include ie-pseudo($styles, $content, after, $name) {
@content;
}
}
@else {
@include ie-pseudo($styles, $content, after, $name);
@include ie-pseudo($styles, $content, after, $name) {
@content;
}
}

// this creates a one-time executing expression that inserts an element relative to `this` element.
// this creates a one-type executing expression that inserts an element relative to `this` element.
// this allows some level of support for :before/:after in IE6/7
// inspired by http://nicolasgallagher.com/better-float-containment-in-ie/
// @mixin ie-pseudo
Expand All @@ -82,14 +72,29 @@
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
$uid: if($uid, $uid, unique('ie-pseudo-'));
$archetype-pseudo-selector: '& ##{$uid}';
$this: 't';
$cmd: (unquote('#{$this}.el=document.createElement("#{prefixed-tag($name)}")'));
$method: if($placement == before, insertBefore, appendChild);
$content: if($content and $content != nil, 'this.el.innerHTML="#{-ie-pseudo-content($content)}",', '');
@if $content and $content != nil {
$cmd: append($cmd, unquote('#{$this}.el.innerHTML="#{-ie-pseudo-content($content)}"'), comma);
}
@if $CONFIG_GENERATED_TAG_CSS {
$styles: if($styles and $styles != nil, #{$CONFIG_GENERATED_TAG_CSS}#{$styles}, $CONFIG_GENERATED_TAG_CSS);
}
// if we're using inline styles...
$inline: if($styles and $styles != nil and $CONFIG_GENERATED_TAG_INLINE, 'this.el.style.cssText="#{$styles}",', '');
*zoom: expression(this.runtimeStyle.zoom="1", this.el=document.createElement("#{prefixed-tag($name)}"),this.el.id="#{$uid}",#{$content}#{$inline}this.#{$method}(this.el));
@if $styles and $styles != nil and $styles != '' and $CONFIG_GENERATED_TAG_INLINE {
// sets the icon styles on the node
$cmd: append($cmd, unquote('#{$this}.el.style.cssText="#{$styles}"'), comma);
}
// if we're using the insertBefore method, we need to specify the node reference to the first childNode
$reference-node: if($placement == before, ',#{$this}.childNodes[0]||null', '');
$cmd: append($cmd, unquote('#{$this}.#{$method}(#{$this}.el#{$reference-node})'), comma);
$runOnce: unquote('this.runtimeStyle.zoom="1"'); // this ensures the expression is only invoked once

// we execute in a setTimeout to decouple from the current UI thread
// this prevents an edge case in IE crashing with an `Operation Aborted` if the node hasn't finished rendering yet
// http://www.nczonline.net/blog/2008/03/17/the-dreaded-operation-aborted-error/
*zoom: expression(#{$runOnce},(function(#{$this}){setTimeout(function(){#{$cmd}})}(this)));

// if we're NOT using inline styles...
@if not $CONFIG_GENERATED_TAG_INLINE {
// output it on the generated selector
Expand All @@ -113,4 +118,4 @@
@if $url {
@include target-browser(ie lte 7, background, append($bg, $url));
}
}
}
51 changes: 29 additions & 22 deletions stylesheets/archetype/_ui.scss
Expand Up @@ -71,7 +71,7 @@
// @param $color {Color} the color of the arrow
@mixin triangle($direction: bottom, $width: 1em, $height: false, $color: #aaa) {
$direction: rtl($direction);
// if no height was specified, assume it's identical to width
// if no height was specified, assume it's identitcal to width
@if(not $height) {
$height: $width;
}
Expand Down Expand Up @@ -125,7 +125,7 @@
// @param $width {String} value for the width property
// @param $overflow {String} value for the overflow property
@mixin unhide-element($position: static, $height:auto, $width:auto, $overflow:visible) {
position: $position;
position: $position !important;
height: $height;
width: $width;
overflow: $overflow;
Expand Down Expand Up @@ -192,7 +192,7 @@
}
// if the size is under a given threshold, use a halfling, if available
@if $icon {
$char-code: nth-cyclic(-compass-list($char-code), if(comparable($CONFIG_GLYPHS_THRESHOLD, $size) and $size <= $CONFIG_GLYPHS_THRESHOLD, 2, 1));
$char-code: nth(-compass-list($char-code), 1);
}
$selector: if(index(before after, $placement), '&:#{$placement}', '&');
#{$selector} {
Expand Down Expand Up @@ -220,15 +220,14 @@
@if($ie-styles) {
$styles: $styles + $ie-styles;
}

@include ie-pseudo($styles: $styles, $content: $char-code, $placement: $placement, $name: glyph, $uid: $ie-uid);
@if $archetype-pseudo-selector {
$archetype-glyph-selector: '#{$selector}, #{$archetype-pseudo-selector}';
}
}
@if archetype-version('Sass >= 3.2') {
#{$archetype-glyph-selector} {
@content;
}
#{$archetype-glyph-selector} {
@content;
}
}
}
Expand Down Expand Up @@ -270,25 +269,33 @@
}
}
@else {
@-webkit-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
@if $experimental-support-for-webkit {
@-webkit-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
}
@-moz-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
@if $experimental-support-for-mozilla {
@-moz-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
}
@-ms-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
@if $experimental-support-for-microsoft {
@-ms-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
}
@-o-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -o-transform: rotate(0deg); }
to { -o-transform: rotate(360deg); }
@if $experimental-support-for-opera {
@-o-keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { -o-transform: rotate(0deg); }
to { -o-transform: rotate(360deg); }
}
}
@keyframes #{$CONFIG_KEYFRAME_LOADERS} {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
}
}
Expand Down Expand Up @@ -350,4 +357,4 @@
border: none;
padding: 0;
@include appearance(none);
}
}

0 comments on commit cd1d610

Please sign in to comment.