From e62b7942d6df1f2fa9c98d254c7a06cc84393eae Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 24 Aug 2008 17:16:51 -0700 Subject: [PATCH] YUI's base and fonts. Their reset is already in compass core. Grid is still to come -- I'm still getting my head around its semantics. --- examples/yui_default/stylesheets/screen.sass | 14 +++++ frameworks/yui/stylesheets/yui/_screen.sass | 5 ++ .../yui/stylesheets/yui/modules/_base.sass | 60 +++++++++++++++++++ .../yui/stylesheets/yui/modules/_fonts.sass | 52 ++++++++++++++++ frameworks/yui/templates/project/screen.sass | 8 +++ lib/compass/frameworks.rb | 1 + lib/compass/frameworks/yui.rb | 2 + 7 files changed, 142 insertions(+) create mode 100644 examples/yui_default/stylesheets/screen.sass create mode 100644 frameworks/yui/stylesheets/yui/_screen.sass create mode 100644 frameworks/yui/stylesheets/yui/modules/_base.sass create mode 100644 frameworks/yui/stylesheets/yui/modules/_fonts.sass create mode 100644 frameworks/yui/templates/project/screen.sass create mode 100644 lib/compass/frameworks/yui.rb diff --git a/examples/yui_default/stylesheets/screen.sass b/examples/yui_default/stylesheets/screen.sass new file mode 100644 index 00000000..59bbbf65 --- /dev/null +++ b/examples/yui_default/stylesheets/screen.sass @@ -0,0 +1,14 @@ +@import yui/screen +@import compass/reset + +html + +reset-html + +body + +yui + +#my-small-element + +yui-font-size(10px) + +#my-big-element + +yui-font-size(24px) \ No newline at end of file diff --git a/frameworks/yui/stylesheets/yui/_screen.sass b/frameworks/yui/stylesheets/yui/_screen.sass new file mode 100644 index 00000000..38dcb5ab --- /dev/null +++ b/frameworks/yui/stylesheets/yui/_screen.sass @@ -0,0 +1,5 @@ +@import modules/base +@import modules/fonts +=yui + +yui-base + +yui-fonts \ No newline at end of file diff --git a/frameworks/yui/stylesheets/yui/modules/_base.sass b/frameworks/yui/stylesheets/yui/modules/_base.sass new file mode 100644 index 00000000..7f95b886 --- /dev/null +++ b/frameworks/yui/stylesheets/yui/modules/_base.sass @@ -0,0 +1,60 @@ +=yui-base + h1 + :font-size 138.5% + + h2 + :font-size 123.1% + + h3 + :font-size 108% + + h1, h2, h3 + :margin 1em 0 + + h1,h2, h3, h4, h5, h6, strong + :font-weight bold + + abbr, acronym + :border-bottom 1px dotted #000 + :cursor help + + em + :font-style italic + + blockquote + :margin 1em + + ul + :margin 1em + :margin-left 2em + li + :list-style disc outside + + ol + :margin 1em + :margin-left 2em + li + :list-style decimal outside + + dl + :margin 1em + :margin-left 2em + dd + :margin-left 1em + + th + :border 1px solid #000 + :padding .5em + :font-weight bold + :text-align center + + td + :border 1px solid #000 + :padding .5em + + caption + :margin-bottom .5em + :text-align center + + p, fieldset, table + :margin-bottom 1em diff --git a/frameworks/yui/stylesheets/yui/modules/_fonts.sass b/frameworks/yui/stylesheets/yui/modules/_fonts.sass new file mode 100644 index 00000000..f16bba24 --- /dev/null +++ b/frameworks/yui/stylesheets/yui/modules/_fonts.sass @@ -0,0 +1,52 @@ +// Converts pixels to percents according to +// the table found at http://developer.yahoo.com/yui/fonts/#fontsize +=yui-font-size(!size) + @if !size == 10px + :font-size 77% + @if !size == 11px + :font-size 85% + @if !size == 12px + :font-size 93% + @if !size == 13px + :font-size 100% + @if !size == 14px + :font-size 108% + @if !size == 15px + :font-size 116% + @if !size == 16px + :font-size 123.1% + @if !size == 17px + :font-size 131% + @if !size == 18px + :font-size 138.5% + @if !size == 19px + :font-size 146.5% + @if !size == 20px + :font-size 153.9% + @if !size == 21px + :font-size 161.6% + @if !size == 22px + :font-size 167% + @if !size == 23px + :font-size 174% + @if !size == 24px + :font-size 182% + @if !size == 25px + :font-size 189% + @if !size == 26px + :font-size 197% + +=yui-fonts + body + :font 13px/1.231 arial,helvetica,clean,sans-serif + :*font-size small + :*font x-small + + table + :font-size inherit + :font 100% + + pre, code, kbd, samp, tt + :font-family monospace + :*font-size 108% + :line-height 100% diff --git a/frameworks/yui/templates/project/screen.sass b/frameworks/yui/templates/project/screen.sass new file mode 100644 index 00000000..d6bec653 --- /dev/null +++ b/frameworks/yui/templates/project/screen.sass @@ -0,0 +1,8 @@ +@import yui/screen +@import compass/reset + +html + +reset-html + +body + +yui diff --git a/lib/compass/frameworks.rb b/lib/compass/frameworks.rb index fc64f0fc..58582891 100644 --- a/lib/compass/frameworks.rb +++ b/lib/compass/frameworks.rb @@ -24,3 +24,4 @@ end require File.join(File.dirname(__FILE__), 'frameworks', 'compass') require File.join(File.dirname(__FILE__), 'frameworks', 'blueprint') +require File.join(File.dirname(__FILE__), 'frameworks', 'yui') diff --git a/lib/compass/frameworks/yui.rb b/lib/compass/frameworks/yui.rb new file mode 100644 index 00000000..00b41003 --- /dev/null +++ b/lib/compass/frameworks/yui.rb @@ -0,0 +1,2 @@ +yui_dir = File.join(Compass.base_directory, 'frameworks', 'yui') +Compass::Frameworks.register('yui', yui_dir)