From 77fa3f35b555c203fd7c7519fb004c5bbf7d87bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Tue, 12 Aug 2014 22:44:18 -0700 Subject: [PATCH 1/8] Minimal updates for Jekyll 2.0 --- .gitignore | 1 - docs/Gemfile | 11 ++--- docs/Gemfile.lock | 88 +++++++++++++++++++++-------------- docs/Rakefile | 10 +--- docs/_config.yml | 5 +- docs/{_css => css}/react.scss | 2 + 6 files changed, 64 insertions(+), 53 deletions(-) rename docs/{_css => css}/react.scss (99%) diff --git a/.gitignore b/.gitignore index a036ec3a6be..fac6da38e4f 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ build/ docs/code docs/_site docs/.sass-cache -docs/css/react.css docs/js/* docs/downloads examples/shared/*.js diff --git a/docs/Gemfile b/docs/Gemfile index 4b8734cff73..56b9cdeeb5e 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -3,19 +3,14 @@ source 'https://rubygems.org' gem 'rake' # jekyll, which builds it all -gem 'jekyll', '~>1.3.0' +# 2.0 includes sass processing +gem 'jekyll', '~>2.0' # JSON gem 'json' -# SASS for CSS -gem 'sass' - # For `rake watch` gem 'rb-fsevent' -# Redcarpet for Markdown -gem 'redcarpet' - # For markdown header cleanup -gem 'sanitize' +gem 'sanitize', '~>2.0' diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 2324fda47fa..cd585ba5aa8 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,61 +1,79 @@ GEM remote: https://rubygems.org/ specs: - classifier (1.3.3) + blankslate (2.1.2.4) + celluloid (0.15.2) + timers (~> 1.1.0) + classifier (1.3.4) fast-stemmer (>= 1.0.0) + coffee-script (2.3.0) + coffee-script-source + execjs + coffee-script-source (1.7.1) colorator (0.1) - commander (4.1.5) - highline (~> 1.6.11) + execjs (2.2.1) fast-stemmer (1.0.2) ffi (1.9.3) - highline (1.6.20) - jekyll (1.3.0) + jekyll (2.2.0) classifier (~> 1.3) colorator (~> 0.1) - commander (~> 4.1.3) - liquid (~> 2.5.2) - listen (~> 1.3) - maruku (~> 0.6.0) - pygments.rb (~> 0.5.0) - redcarpet (~> 2.3.0) - safe_yaml (~> 0.9.7) + jekyll-coffeescript (~> 1.0) + jekyll-gist (~> 1.0) + jekyll-paginate (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.0) + kramdown (~> 1.3) + liquid (~> 2.6.1) + mercenary (~> 0.3.3) + pygments.rb (~> 0.6.0) + redcarpet (~> 3.1) + safe_yaml (~> 1.0) + toml (~> 0.1.0) + jekyll-coffeescript (1.0.0) + coffee-script (~> 2.2) + jekyll-gist (1.1.0) + jekyll-paginate (1.0.0) + jekyll-sass-converter (1.2.0) + sass (~> 3.2) + jekyll-watch (1.1.0) + listen (~> 2.7) json (1.8.1) - liquid (2.5.4) - listen (1.3.1) + kramdown (1.4.1) + liquid (2.6.1) + listen (2.7.9) + celluloid (>= 0.15.2) rb-fsevent (>= 0.9.3) rb-inotify (>= 0.9) - rb-kqueue (>= 0.2) - maruku (0.6.1) - syntax (>= 1.0.0) - mini_portile (0.5.2) - nokogiri (1.6.0) - mini_portile (~> 0.5.0) - posix-spawn (0.3.6) - pygments.rb (0.5.4) + mercenary (0.3.4) + mini_portile (0.6.0) + nokogiri (1.6.3.1) + mini_portile (= 0.6.0) + parslet (1.5.0) + blankslate (~> 2.0) + posix-spawn (0.3.9) + pygments.rb (0.6.0) posix-spawn (~> 0.3.6) yajl-ruby (~> 1.1.0) - rake (10.1.0) - rb-fsevent (0.9.3) - rb-inotify (0.9.2) + rake (10.3.2) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) ffi (>= 0.5.0) - rb-kqueue (0.2.0) - ffi (>= 0.5.0) - redcarpet (2.3.0) - safe_yaml (0.9.7) + redcarpet (3.1.2) + safe_yaml (1.0.3) sanitize (2.0.6) nokogiri (>= 1.4.4) - sass (3.2.12) - syntax (1.0.0) + sass (3.3.14) + timers (1.1.0) + toml (0.1.1) + parslet (~> 1.5.0) yajl-ruby (1.1.0) PLATFORMS ruby DEPENDENCIES - jekyll (~> 1.3.0) + jekyll (~> 2.0) json rake rb-fsevent - redcarpet - sanitize - sass + sanitize (~> 2.0) diff --git a/docs/Rakefile b/docs/Rakefile index f10e317902b..9fd343cd706 100644 --- a/docs/Rakefile +++ b/docs/Rakefile @@ -2,19 +2,13 @@ require('rubygems') require('json') require('yaml') -desc "generate css from sass" -task :css do - system "sass --style=compressed _css/react.scss css/react.css" -end - desc "generate js from jsx" task :js do system "../bin/jsx _js js" end -desc "watch css & js" +desc "watch js" task :watch do - Process.spawn "sass --style=compressed --watch _css/react.scss:css/react.css" Process.spawn "../bin/jsx --watch _js js" Process.waitall end @@ -34,4 +28,4 @@ task :release => [:update_version, :default] do system "jekyll build -d ../../react-gh-pages" end -task :default => [:css, :js] +task :default => [:js] diff --git a/docs/_config.yml b/docs/_config.yml index 630e3f862e2..8d702349236 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -10,7 +10,7 @@ exclude: redcarpet: extensions: - fenced_code_blocks -pygments: true +highlighter: pygments name: React markdown: redcarpet react_version: 0.11.1 @@ -19,3 +19,6 @@ relative_permalinks: true paginate: 5 paginate_path: "/blog/page:num/" timezone: America/Los_Angeles +sass: + style: :compressed + sass_dir: _css diff --git a/docs/_css/react.scss b/docs/css/react.scss similarity index 99% rename from docs/_css/react.scss rename to docs/css/react.scss index ce8c3da220c..938f5593805 100644 --- a/docs/_css/react.scss +++ b/docs/css/react.scss @@ -1,3 +1,5 @@ +--- +--- @import 'bourbon/bourbon'; @import '_variables'; @import '_typography'; From 8dbdd53e46c4834b7f8db0da321736d26f9784a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 11:14:24 -0700 Subject: [PATCH 2/8] Reorder _config for sanity --- docs/_config.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 8d702349236..e6bf45c8928 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,24 +1,24 @@ --- -baseurl: "/react" +name: React +description: A JavaScript library for building user interfaces url: http://facebook.github.io +baseurl: "/react" permalink: "/blog/:year/:month/:day/:title.html" +paginate_path: "/blog/page:num/" +relative_permalinks: true +paginate: 5 +timezone: America/Los_Angeles +highlighter: pygments exclude: - Gemfile - Gemfile.lock - README.md - Rakefile +markdown: redcarpet redcarpet: extensions: - fenced_code_blocks -highlighter: pygments -name: React -markdown: redcarpet -react_version: 0.11.1 -description: A JavaScript library for building user interfaces -relative_permalinks: true -paginate: 5 -paginate_path: "/blog/page:num/" -timezone: America/Los_Angeles sass: style: :compressed sass_dir: _css +react_version: 0.11.1 From b58b9d0b794a401c5ab75dae24963484f3af86df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 11:20:00 -0700 Subject: [PATCH 3/8] Update Bourbon files (4.0.2) --- .../bourbon/_bourbon-deprecated-upcoming.scss | 11 +- docs/_css/bourbon/_bourbon.scss | 30 +- docs/_css/bourbon/addons/_button.scss | 183 +++++++++--- docs/_css/bourbon/addons/_clearfix.scss | 16 +- .../bourbon/addons/_directional-values.scss | 111 ++++++++ docs/_css/bourbon/addons/_ellipsis.scss | 7 + docs/_css/bourbon/addons/_font-family.scss | 2 +- docs/_css/bourbon/addons/_hide-text.scss | 11 +- .../bourbon/addons/_html5-input-types.scss | 64 +++-- docs/_css/bourbon/addons/_position.scss | 24 +- docs/_css/bourbon/addons/_prefixer.scss | 16 +- docs/_css/bourbon/addons/_retina-image.scss | 15 +- docs/_css/bourbon/addons/_size.scss | 46 +-- .../bourbon/addons/_timing-functions.scss | 2 +- docs/_css/bourbon/addons/_triangle.scss | 64 ++++- docs/_css/bourbon/addons/_word-wrap.scss | 8 + docs/_css/bourbon/css3/_background-image.scss | 64 ++--- docs/_css/bourbon/css3/_background.scss | 122 +++----- docs/_css/bourbon/css3/_border-image.scss | 86 +++--- docs/_css/bourbon/css3/_calc.scss | 4 + docs/_css/bourbon/css3/_columns.scss | 2 +- docs/_css/bourbon/css3/_filter.scss | 5 + docs/_css/bourbon/css3/_flex-box.scss | 269 ++++++++++++++++++ docs/_css/bourbon/css3/_font-face.scss | 2 +- .../bourbon/css3/_font-feature-settings.scss | 10 + docs/_css/bourbon/css3/_hyphens.scss | 4 + docs/_css/bourbon/css3/_image-rendering.scss | 7 +- docs/_css/bourbon/css3/_inline-block.scss | 8 - docs/_css/bourbon/css3/_keyframes.scss | 26 +- docs/_css/bourbon/css3/_linear-gradient.scss | 17 +- docs/_css/bourbon/css3/_placeholder.scss | 27 +- docs/_css/bourbon/css3/_radial-gradient.scss | 17 +- docs/_css/bourbon/css3/_transition.scss | 57 +++- docs/_css/bourbon/functions/_assign.scss | 11 + .../bourbon/functions/_color-lightness.scss | 13 + docs/_css/bourbon/functions/_compact.scss | 11 - .../_css/bourbon/functions/_golden-ratio.scss | 3 + .../bourbon/functions/_linear-gradient.scss | 13 - .../bourbon/functions/_modular-scale.scss | 82 ++++-- docs/_css/bourbon/functions/_px-to-em.scss | 9 +- docs/_css/bourbon/functions/_px-to-rem.scss | 15 + .../bourbon/functions/_radial-gradient.scss | 23 -- docs/_css/bourbon/functions/_strip-units.scss | 5 + docs/_css/bourbon/functions/_unpack.scss | 17 ++ docs/_css/bourbon/helpers/_convert-units.scss | 15 + .../helpers/_deprecated-webkit-gradient.scss | 39 --- docs/_css/bourbon/helpers/_is-num.scss | 8 + .../bourbon/helpers/_linear-angle-parser.scss | 25 ++ .../helpers/_linear-gradient-parser.scss | 41 +++ .../helpers/_linear-side-corner-parser.scss | 31 ++ .../bourbon/helpers/_radial-arg-parser.scss | 8 +- .../helpers/_radial-gradient-parser.scss | 50 ++++ docs/_css/bourbon/helpers/_str-to-num.scss | 50 ++++ .../bourbon/settings/_asset-pipeline.scss | 1 + docs/_css/bourbon/settings/_prefixer.scss | 6 + docs/_css/bourbon/settings/_px-to-em.scss | 1 + 56 files changed, 1279 insertions(+), 535 deletions(-) create mode 100644 docs/_css/bourbon/addons/_directional-values.scss create mode 100644 docs/_css/bourbon/addons/_ellipsis.scss create mode 100644 docs/_css/bourbon/addons/_word-wrap.scss create mode 100644 docs/_css/bourbon/css3/_calc.scss create mode 100644 docs/_css/bourbon/css3/_filter.scss create mode 100644 docs/_css/bourbon/css3/_font-feature-settings.scss create mode 100644 docs/_css/bourbon/css3/_hyphens.scss delete mode 100644 docs/_css/bourbon/css3/_inline-block.scss create mode 100644 docs/_css/bourbon/functions/_assign.scss create mode 100644 docs/_css/bourbon/functions/_color-lightness.scss delete mode 100644 docs/_css/bourbon/functions/_compact.scss create mode 100644 docs/_css/bourbon/functions/_golden-ratio.scss delete mode 100644 docs/_css/bourbon/functions/_linear-gradient.scss create mode 100644 docs/_css/bourbon/functions/_px-to-rem.scss delete mode 100644 docs/_css/bourbon/functions/_radial-gradient.scss create mode 100644 docs/_css/bourbon/functions/_strip-units.scss create mode 100644 docs/_css/bourbon/functions/_unpack.scss create mode 100644 docs/_css/bourbon/helpers/_convert-units.scss delete mode 100644 docs/_css/bourbon/helpers/_deprecated-webkit-gradient.scss create mode 100644 docs/_css/bourbon/helpers/_is-num.scss create mode 100644 docs/_css/bourbon/helpers/_linear-angle-parser.scss create mode 100644 docs/_css/bourbon/helpers/_linear-gradient-parser.scss create mode 100644 docs/_css/bourbon/helpers/_linear-side-corner-parser.scss create mode 100644 docs/_css/bourbon/helpers/_radial-gradient-parser.scss create mode 100644 docs/_css/bourbon/helpers/_str-to-num.scss create mode 100644 docs/_css/bourbon/settings/_asset-pipeline.scss create mode 100644 docs/_css/bourbon/settings/_prefixer.scss create mode 100644 docs/_css/bourbon/settings/_px-to-em.scss diff --git a/docs/_css/bourbon/_bourbon-deprecated-upcoming.scss b/docs/_css/bourbon/_bourbon-deprecated-upcoming.scss index 5332496d82e..f946b3b456d 100644 --- a/docs/_css/bourbon/_bourbon-deprecated-upcoming.scss +++ b/docs/_css/bourbon/_bourbon-deprecated-upcoming.scss @@ -2,12 +2,7 @@ // These mixins/functions are deprecated // They will be removed in the next MAJOR version release //************************************************************************// -@mixin box-shadow ($shadows...) { - @include prefixer(box-shadow, $shadows, spec); - @warn "box-shadow is deprecated and will be removed in the next major version release"; -} - -@mixin background-size ($lengths...) { - @include prefixer(background-size, $lengths, spec); - @warn "background-size is deprecated and will be removed in the next major version release"; +@mixin inline-block { + display: inline-block; + @warn "inline-block mixin is deprecated and will be removed in the next major version release"; } diff --git a/docs/_css/bourbon/_bourbon.scss b/docs/_css/bourbon/_bourbon.scss index 53fbca877f0..eea6e21e9ed 100644 --- a/docs/_css/bourbon/_bourbon.scss +++ b/docs/_css/bourbon/_bourbon.scss @@ -1,22 +1,36 @@ +// Settings +@import "settings/prefixer"; +@import "settings/px-to-em"; +@import "settings/asset-pipeline"; + // Custom Helpers -@import "helpers/deprecated-webkit-gradient"; +@import "helpers/convert-units"; @import "helpers/gradient-positions-parser"; +@import "helpers/is-num"; +@import "helpers/linear-angle-parser"; +@import "helpers/linear-gradient-parser"; @import "helpers/linear-positions-parser"; +@import "helpers/linear-side-corner-parser"; @import "helpers/radial-arg-parser"; @import "helpers/radial-positions-parser"; +@import "helpers/radial-gradient-parser"; @import "helpers/render-gradients"; @import "helpers/shape-size-stripper"; +@import "helpers/str-to-num"; // Custom Functions -@import "functions/compact"; +@import "functions/assign"; +@import "functions/color-lightness"; @import "functions/flex-grid"; +@import "functions/golden-ratio"; @import "functions/grid-width"; -@import "functions/linear-gradient"; @import "functions/modular-scale"; @import "functions/px-to-em"; -@import "functions/radial-gradient"; +@import "functions/px-to-rem"; +@import "functions/strip-units"; @import "functions/tint-shade"; @import "functions/transition-property-name"; +@import "functions/unpack"; // CSS3 Mixins @import "css3/animation"; @@ -27,12 +41,15 @@ @import "css3/border-image"; @import "css3/border-radius"; @import "css3/box-sizing"; +@import "css3/calc"; @import "css3/columns"; +@import "css3/filter"; @import "css3/flex-box"; @import "css3/font-face"; +@import "css3/font-feature-settings"; +@import "css3/hyphens"; @import "css3/hidpi-media-query"; @import "css3/image-rendering"; -@import "css3/inline-block"; @import "css3/keyframes"; @import "css3/linear-gradient"; @import "css3/perspective"; @@ -45,6 +62,8 @@ // Addons & other mixins @import "addons/button"; @import "addons/clearfix"; +@import "addons/directional-values"; +@import "addons/ellipsis"; @import "addons/font-family"; @import "addons/hide-text"; @import "addons/html5-input-types"; @@ -54,6 +73,7 @@ @import "addons/size"; @import "addons/timing-functions"; @import "addons/triangle"; +@import "addons/word-wrap"; // Soon to be deprecated Mixins @import "bourbon-deprecated-upcoming"; diff --git a/docs/_css/bourbon/addons/_button.scss b/docs/_css/bourbon/addons/_button.scss index 3ae393c090f..14a89e480c1 100644 --- a/docs/_css/bourbon/addons/_button.scss +++ b/docs/_css/bourbon/addons/_button.scss @@ -1,38 +1,51 @@ -@mixin button ($style: simple, $base-color: #4294f0) { +@mixin button ($style: simple, $base-color: #4294f0, $text-size: inherit, $padding: 7px 18px) { - @if type-of($style) == color { + @if type-of($style) == string and type-of($base-color) == color { + @include buttonstyle($style, $base-color, $text-size, $padding); + } + + @if type-of($style) == string and type-of($base-color) == number { + $padding: $text-size; + $text-size: $base-color; + $base-color: #4294f0; + + @if $padding == inherit { + $padding: 7px 18px; + } + + @include buttonstyle($style, $base-color, $text-size, $padding); + } + + @if type-of($style) == color and type-of($base-color) == color { $base-color: $style; $style: simple; + @include buttonstyle($style, $base-color, $text-size, $padding); } - // Grayscale button - @if $base-color == grayscale($base-color) { - @if $style == simple { - @include simple($base-color, $grayscale: true); - } + @if type-of($style) == color and type-of($base-color) == number { + $padding: $text-size; + $text-size: $base-color; + $base-color: $style; + $style: simple; - @else if $style == shiny { - @include shiny($base-color, $grayscale: true); + @if $padding == inherit { + $padding: 7px 18px; } - @else if $style == pill { - @include pill($base-color, $grayscale: true); - } + @include buttonstyle($style, $base-color, $text-size, $padding); } - // Colored button - @else { - @if $style == simple { - @include simple($base-color); - } + @if type-of($style) == number { + $padding: $base-color; + $text-size: $style; + $base-color: #4294f0; + $style: simple; - @else if $style == shiny { - @include shiny($base-color); + @if $padding == #4294f0 { + $padding: 7px 18px; } - @else if $style == pill { - @include pill($base-color); - } + @include buttonstyle($style, $base-color, $text-size, $padding); } &:disabled { @@ -42,16 +55,55 @@ } +// Selector Style Button +//************************************************************************// +@mixin buttonstyle($type, $b-color, $t-size, $pad) { + // Grayscale button + @if $type == simple and $b-color == grayscale($b-color) { + @include simple($b-color, true, $t-size, $pad); + } + + @if $type == shiny and $b-color == grayscale($b-color) { + @include shiny($b-color, true, $t-size, $pad); + } + + @if $type == pill and $b-color == grayscale($b-color) { + @include pill($b-color, true, $t-size, $pad); + } + + @if $type == flat and $b-color == grayscale($b-color) { + @include flat($b-color, true, $t-size, $pad); + } + + // Colored button + @if $type == simple { + @include simple($b-color, false, $t-size, $pad); + } + + @else if $type == shiny { + @include shiny($b-color, false, $t-size, $pad); + } + + @else if $type == pill { + @include pill($b-color, false, $t-size, $pad); + } + + @else if $type == flat { + @include flat($b-color, false, $t-size, $pad); + } +} + + // Simple Button //************************************************************************// -@mixin simple($base-color, $grayscale: false) { +@mixin simple($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) { $color: hsl(0, 0, 100%); $border: adjust-color($base-color, $saturation: 9%, $lightness: -14%); $inset-shadow: adjust-color($base-color, $saturation: -8%, $lightness: 15%); $stop-gradient: adjust-color($base-color, $saturation: 9%, $lightness: -11%); $text-shadow: adjust-color($base-color, $saturation: 15%, $lightness: -18%); - @if lightness($base-color) > 70% { + @if is-light($base-color) { $color: hsl(0, 0, 20%); $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); } @@ -68,10 +120,10 @@ box-shadow: inset 0 1px 0 0 $inset-shadow; color: $color; display: inline-block; - font-size: 11px; + font-size: $textsize; font-weight: bold; @include linear-gradient ($base-color, $stop-gradient); - padding: 7px 18px; + padding: $padding; text-decoration: none; text-shadow: 0 1px 0 $text-shadow; background-clip: padding-box; @@ -92,7 +144,8 @@ @include linear-gradient ($base-color-hover, $stop-gradient-hover); } - &:active:not(:disabled) { + &:active:not(:disabled), + &:focus:not(:disabled) { $border-active: adjust-color($base-color, $saturation: 9%, $lightness: -14%); $inset-shadow-active: adjust-color($base-color, $saturation: 7%, $lightness: -17%); @@ -102,14 +155,14 @@ } border: 1px solid $border-active; - box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active, 0 1px 1px 0 #eee; + box-shadow: inset 0 0 8px 4px $inset-shadow-active, inset 0 0 8px 4px $inset-shadow-active; } } // Shiny Button //************************************************************************// -@mixin shiny($base-color, $grayscale: false) { +@mixin shiny($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) { $color: hsl(0, 0, 100%); $border: adjust-color($base-color, $red: -117, $green: -111, $blue: -81); $border-bottom: adjust-color($base-color, $red: -126, $green: -127, $blue: -122); @@ -119,7 +172,7 @@ $text-shadow: adjust-color($base-color, $red: -140, $green: -141, $blue: -114); $third-stop: adjust-color($base-color, $red: -86, $green: -75, $blue: -48); - @if lightness($base-color) > 70% { + @if is-light($base-color) { $color: hsl(0, 0, 20%); $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); } @@ -140,10 +193,10 @@ box-shadow: inset 0 1px 0 0 $inset-shadow; color: $color; display: inline-block; - font-size: 14px; + font-size: $textsize; font-weight: bold; @include linear-gradient(top, $base-color 0%, $second-stop 50%, $third-stop 50%, $fourth-stop 100%); - padding: 8px 20px; + padding: $padding; text-align: center; text-decoration: none; text-shadow: 0 -1px 1px $text-shadow; @@ -168,21 +221,22 @@ $fourth-stop-hover 100%); } - &:active:not(:disabled) { + &:active:not(:disabled), + &:focus:not(:disabled) { $inset-shadow-active: adjust-color($base-color, $red: -111, $green: -116, $blue: -122); @if $grayscale == true { $inset-shadow-active: grayscale($inset-shadow-active); } - box-shadow: inset 0 0 20px 0 $inset-shadow-active, 0 1px 0 #fff; + box-shadow: inset 0 0 20px 0 $inset-shadow-active; } } // Pill Button //************************************************************************// -@mixin pill($base-color, $grayscale: false) { +@mixin pill($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) { $color: hsl(0, 0, 100%); $border-bottom: adjust-color($base-color, $hue: 8, $saturation: -11%, $lightness: -26%); $border-sides: adjust-color($base-color, $hue: 4, $saturation: -21%, $lightness: -21%); @@ -191,7 +245,7 @@ $stop-gradient: adjust-color($base-color, $hue: 8, $saturation: 14%, $lightness: -10%); $text-shadow: adjust-color($base-color, $hue: 5, $saturation: -19%, $lightness: -15%); - @if lightness($base-color) > 70% { + @if is-light($base-color) { $color: hsl(0, 0, 20%); $text-shadow: adjust-color($base-color, $saturation: 10%, $lightness: 4%); } @@ -208,14 +262,14 @@ border: 1px solid $border-top; border-color: $border-top $border-sides $border-bottom; border-radius: 16px; - box-shadow: inset 0 1px 0 0 $inset-shadow, 0 1px 2px 0 #b3b3b3; + box-shadow: inset 0 1px 0 0 $inset-shadow; color: $color; display: inline-block; - font-size: 11px; + font-size: $textsize; font-weight: normal; line-height: 1; @include linear-gradient ($base-color, $stop-gradient); - padding: 5px 16px; + padding: $padding; text-align: center; text-decoration: none; text-shadow: 0 -1px 1px $text-shadow; @@ -249,7 +303,8 @@ background-clip: padding-box; } - &:active:not(:disabled) { + &:active:not(:disabled), + &:focus:not(:disabled) { $active-color: adjust-color($base-color, $hue: 4, $saturation: -12%, $lightness: -10%); $border-active: adjust-color($base-color, $hue: 6, $saturation: -2.5%, $lightness: -30%); $border-bottom-active: adjust-color($base-color, $hue: 11, $saturation: 6%, $lightness: -31%); @@ -267,7 +322,53 @@ background: $active-color; border: 1px solid $border-active; border-bottom: 1px solid $border-bottom-active; - box-shadow: inset 0 0 6px 3px $inset-shadow-active, 0 1px 0 0 #fff; + box-shadow: inset 0 0 6px 3px $inset-shadow-active; text-shadow: 0 -1px 1px $text-shadow-active; } } + + + +// Flat Button +//************************************************************************// +@mixin flat($base-color, $grayscale: false, $textsize: inherit, $padding: 7px 18px) { + $color: hsl(0, 0, 100%); + + @if is-light($base-color) { + $color: hsl(0, 0, 20%); + } + + background-color: $base-color; + border-radius: 3px; + border: none; + color: $color; + display: inline-block; + font-size: inherit; + font-weight: bold; + padding: 7px 18px; + text-decoration: none; + background-clip: padding-box; + + &:hover:not(:disabled){ + $base-color-hover: adjust-color($base-color, $saturation: 4%, $lightness: 5%); + + @if $grayscale == true { + $base-color-hover: grayscale($base-color-hover); + } + + background-color: $base-color-hover; + cursor: pointer; + } + + &:active:not(:disabled), + &:focus:not(:disabled) { + $base-color-active: adjust-color($base-color, $saturation: -4%, $lightness: -5%); + + @if $grayscale == true { + $base-color-active: grayscale($base-color-active); + } + + background-color: $base-color-active; + cursor: pointer; + } +} diff --git a/docs/_css/bourbon/addons/_clearfix.scss b/docs/_css/bourbon/addons/_clearfix.scss index ca9903cf02e..783cfbc7922 100644 --- a/docs/_css/bourbon/addons/_clearfix.scss +++ b/docs/_css/bourbon/addons/_clearfix.scss @@ -1,4 +1,4 @@ -// Micro clearfix provides an easy way to contain floats without adding additional markup +// Modern micro clearfix provides an easy way to contain floats without adding additional markup. // // Example usage: // @@ -12,18 +12,12 @@ // } @mixin clearfix { - *zoom: 1; - - &:before, - &:after { - content: " "; - display: table; - } - &:after { - clear: both; + content:""; + display:table; + clear:both; } } // Acknowledgements -// Micro clearfix: [Nicolas Gallagher](http://nicolasgallagher.com/micro-clearfix-hack/) +// Beat *that* clearfix: [Thierry Koblentz](http://www.css-101.org/articles/clearfix/latest-new-clearfix-so-far.php) diff --git a/docs/_css/bourbon/addons/_directional-values.scss b/docs/_css/bourbon/addons/_directional-values.scss new file mode 100644 index 00000000000..742f1031a48 --- /dev/null +++ b/docs/_css/bourbon/addons/_directional-values.scss @@ -0,0 +1,111 @@ +// directional-property mixins are shorthands +// for writing properties like the following +// +// @include margin(null 0 10px); +// ------ +// margin-right: 0; +// margin-bottom: 10px; +// margin-left: 0; +// +// - or - +// +// @include border-style(dotted null); +// ------ +// border-top-style: dotted; +// border-bottom-style: dotted; +// +// ------ +// +// Note: You can also use false instead of null + +@function collapse-directionals($vals) { + $output: null; + + $A: nth( $vals, 1 ); + $B: if( length($vals) < 2, $A, nth($vals, 2)); + $C: if( length($vals) < 3, $A, nth($vals, 3)); + $D: if( length($vals) < 2, $A, nth($vals, if( length($vals) < 4, 2, 4) )); + + @if $A == 0 { $A: 0 } + @if $B == 0 { $B: 0 } + @if $C == 0 { $C: 0 } + @if $D == 0 { $D: 0 } + + @if $A == $B and $A == $C and $A == $D { $output: $A } + @else if $A == $C and $B == $D { $output: $A $B } + @else if $B == $D { $output: $A $B $C } + @else { $output: $A $B $C $D } + + @return $output; +} + +@function contains-falsy($list) { + @each $item in $list { + @if not $item { + @return true; + } + } + + @return false; +} + +@mixin directional-property($pre, $suf, $vals) { + // Property Names + $top: $pre + "-top" + if($suf, "-#{$suf}", ""); + $bottom: $pre + "-bottom" + if($suf, "-#{$suf}", ""); + $left: $pre + "-left" + if($suf, "-#{$suf}", ""); + $right: $pre + "-right" + if($suf, "-#{$suf}", ""); + $all: $pre + if($suf, "-#{$suf}", ""); + + $vals: collapse-directionals($vals); + + @if contains-falsy($vals) { + @if nth($vals, 1) { #{$top}: nth($vals, 1); } + + @if length($vals) == 1 { + @if nth($vals, 1) { #{$right}: nth($vals, 1); } + } @else { + @if nth($vals, 2) { #{$right}: nth($vals, 2); } + } + + // prop: top/bottom right/left + @if length($vals) == 2 { + @if nth($vals, 1) { #{$bottom}: nth($vals, 1); } + @if nth($vals, 2) { #{$left}: nth($vals, 2); } + + // prop: top right/left bottom + } @else if length($vals) == 3 { + @if nth($vals, 3) { #{$bottom}: nth($vals, 3); } + @if nth($vals, 2) { #{$left}: nth($vals, 2); } + + // prop: top right bottom left + } @else if length($vals) == 4 { + @if nth($vals, 3) { #{$bottom}: nth($vals, 3); } + @if nth($vals, 4) { #{$left}: nth($vals, 4); } + } + + // prop: top/right/bottom/left + } @else { + #{$all}: $vals; + } +} + +@mixin margin($vals...) { + @include directional-property(margin, false, $vals...); +} + +@mixin padding($vals...) { + @include directional-property(padding, false, $vals...); +} + +@mixin border-style($vals...) { + @include directional-property(border, style, $vals...); +} + +@mixin border-color($vals...) { + @include directional-property(border, color, $vals...); +} + +@mixin border-width($vals...) { + @include directional-property(border, width, $vals...); +} diff --git a/docs/_css/bourbon/addons/_ellipsis.scss b/docs/_css/bourbon/addons/_ellipsis.scss new file mode 100644 index 00000000000..a8ea2a4a867 --- /dev/null +++ b/docs/_css/bourbon/addons/_ellipsis.scss @@ -0,0 +1,7 @@ +@mixin ellipsis($width: 100%) { + display: inline-block; + max-width: $width; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} diff --git a/docs/_css/bourbon/addons/_font-family.scss b/docs/_css/bourbon/addons/_font-family.scss index df8a80ddfcf..31f5d9ca75c 100644 --- a/docs/_css/bourbon/addons/_font-family.scss +++ b/docs/_css/bourbon/addons/_font-family.scss @@ -1,5 +1,5 @@ $georgia: Georgia, Cambria, "Times New Roman", Times, serif; -$helvetica: "Helvetica Neue", Helvetica, Arial, sans-serif; +$helvetica: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; $lucida-grande: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif; $monospace: "Bitstream Vera Sans Mono", Consolas, Courier, monospace; $verdana: Verdana, Geneva, sans-serif; diff --git a/docs/_css/bourbon/addons/_hide-text.scss b/docs/_css/bourbon/addons/_hide-text.scss index 68d4bf86cb2..fc7943811d3 100644 --- a/docs/_css/bourbon/addons/_hide-text.scss +++ b/docs/_css/bourbon/addons/_hide-text.scss @@ -1,5 +1,10 @@ @mixin hide-text { - color: transparent; - font: 0/0 a; - text-shadow: none; + overflow: hidden; + + &:before { + content: ""; + display: block; + width: 0; + height: 100%; + } } diff --git a/docs/_css/bourbon/addons/_html5-input-types.scss b/docs/_css/bourbon/addons/_html5-input-types.scss index b184382d910..9e9324ae0a7 100644 --- a/docs/_css/bourbon/addons/_html5-input-types.scss +++ b/docs/_css/bourbon/addons/_html5-input-types.scss @@ -20,29 +20,19 @@ $inputs-list: 'input[type="email"]', 'input[type="time"]', 'input[type="week"]'; -$unquoted-inputs-list: (); -@each $input-type in $inputs-list { - $unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma); -} - -$all-text-inputs: $unquoted-inputs-list; - +// Bare inputs +//************************************************************************// +$all-text-inputs: assign-inputs($inputs-list); // Hover Pseudo-class //************************************************************************// -$all-text-inputs-hover: (); -@each $input-type in $unquoted-inputs-list { - $input-type-hover: $input-type + ":hover"; - $all-text-inputs-hover: append($all-text-inputs-hover, $input-type-hover, comma); -} +$all-text-inputs-hover: assign-inputs($inputs-list, hover); // Focus Pseudo-class //************************************************************************// -$all-text-inputs-focus: (); -@each $input-type in $unquoted-inputs-list { - $input-type-focus: $input-type + ":focus"; - $all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma); -} +$all-text-inputs-focus: assign-inputs($inputs-list, focus); + + // You must use interpolation on the variable: // #{$all-text-inputs} @@ -54,3 +44,43 @@ $all-text-inputs-focus: (); // #{$all-text-inputs}, textarea { // border: 1px solid red; // } + + + +//************************************************************************// +// Generate a variable ($all-button-inputs) with a list of all html5 +// input types that have a button-based input, excluding button. +//************************************************************************// +$inputs-button-list: 'input[type="button"]', + 'input[type="reset"]', + 'input[type="submit"]'; + +// Bare inputs +//************************************************************************// +$all-button-inputs: assign-inputs($inputs-button-list); + +// Hover Pseudo-class +//************************************************************************// +$all-button-inputs-hover: assign-inputs($inputs-button-list, hover); + +// Focus Pseudo-class +//************************************************************************// +$all-button-inputs-focus: assign-inputs($inputs-button-list, focus); + +// Active Pseudo-class +//************************************************************************// +$all-button-inputs-active: assign-inputs($inputs-button-list, active); + + + +// You must use interpolation on the variable: +// #{$all-button-inputs} +// #{$all-button-inputs-hover} +// #{$all-button-inputs-focus} +// #{$all-button-inputs-active} + +// Example +//************************************************************************// +// #{$all-button-inputs}, button { +// border: 1px solid red; +// } diff --git a/docs/_css/bourbon/addons/_position.scss b/docs/_css/bourbon/addons/_position.scss index faad1cae50a..7de75182bc0 100644 --- a/docs/_css/bourbon/addons/_position.scss +++ b/docs/_css/bourbon/addons/_position.scss @@ -1,10 +1,12 @@ -@mixin position ($position: relative, $coordinates: 0 0 0 0) { +@mixin position ($position: relative, $coordinates: null null null null) { @if type-of($position) == list { $coordinates: $position; $position: relative; } + $coordinates: unpack($coordinates); + $top: nth($coordinates, 1); $right: nth($coordinates, 2); $bottom: nth($coordinates, 3); @@ -12,31 +14,19 @@ position: $position; - @if $top == auto { - top: $top; - } - @else if not(unitless($top)) { + @if ($top and $top == auto) or (type-of($top) == number) { top: $top; } - @if $right == auto { - right: $right; - } - @else if not(unitless($right)) { + @if ($right and $right == auto) or (type-of($right) == number) { right: $right; } - @if $bottom == auto { - bottom: $bottom; - } - @else if not(unitless($bottom)) { + @if ($bottom and $bottom == auto) or (type-of($bottom) == number) { bottom: $bottom; } - @if $left == auto { - left: $left; - } - @else if not(unitless($left)) { + @if ($left and $left == auto) or (type-of($left) == number) { left: $left; } } diff --git a/docs/_css/bourbon/addons/_prefixer.scss b/docs/_css/bourbon/addons/_prefixer.scss index 6bfd23a1dd5..c32f502758f 100644 --- a/docs/_css/bourbon/addons/_prefixer.scss +++ b/docs/_css/bourbon/addons/_prefixer.scss @@ -1,11 +1,7 @@ //************************************************************************// // Example: @include prefixer(border-radius, $radii, webkit ms spec); //************************************************************************// -$prefix-for-webkit: true !default; -$prefix-for-mozilla: true !default; -$prefix-for-microsoft: true !default; -$prefix-for-opera: true !default; -$prefix-for-spec: true !default; // required for keyframe mixin +// Variables located in /settings/_prefixer.scss @mixin prefixer ($property, $value, $prefixes) { @each $prefix in $prefixes { @@ -41,9 +37,9 @@ $prefix-for-spec: true !default; // required for keyframe mixin } @mixin disable-prefix-for-all() { - $prefix-for-webkit: false; - $prefix-for-mozilla: false; - $prefix-for-microsoft: false; - $prefix-for-opera: false; - $prefix-for-spec: false; + $prefix-for-webkit: false !global; + $prefix-for-mozilla: false !global; + $prefix-for-microsoft: false !global; + $prefix-for-opera: false !global; + $prefix-for-spec: false !global; } diff --git a/docs/_css/bourbon/addons/_retina-image.scss b/docs/_css/bourbon/addons/_retina-image.scss index ed300715e43..3995c1970a6 100644 --- a/docs/_css/bourbon/addons/_retina-image.scss +++ b/docs/_css/bourbon/addons/_retina-image.scss @@ -1,28 +1,27 @@ -@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $asset-pipeline: false) { +@mixin retina-image($filename, $background-size, $extension: png, $retina-filename: null, $retina-suffix: _2x, $asset-pipeline: $asset-pipeline) { @if $asset-pipeline { - background-image: image_url($filename + "." + $extension); + background-image: image-url("#{$filename}.#{$extension}"); } @else { - background-image: url($filename + "." + $extension); + background-image: url("#{$filename}.#{$extension}"); } @include hidpi { - @if $asset-pipeline { @if $retina-filename { - background-image: image_url($retina-filename + "." + $extension); + background-image: image-url("#{$retina-filename}.#{$extension}"); } @else { - background-image: image_url($filename + "@2x" + "." + $extension); + background-image: image-url("#{$filename}#{$retina-suffix}.#{$extension}"); } } @else { @if $retina-filename { - background-image: url($retina-filename + "." + $extension); + background-image: url("#{$retina-filename}.#{$extension}"); } @else { - background-image: url($filename + "@2x" + "." + $extension); + background-image: url("#{$filename}#{$retina-suffix}.#{$extension}"); } } diff --git a/docs/_css/bourbon/addons/_size.scss b/docs/_css/bourbon/addons/_size.scss index 342e41b79f1..a8653799a7e 100644 --- a/docs/_css/bourbon/addons/_size.scss +++ b/docs/_css/bourbon/addons/_size.scss @@ -1,44 +1,16 @@ @mixin size($size) { - @if length($size) == 1 { - @if $size == auto { - width: $size; - height: $size; - } + $height: nth($size, 1); + $width: $height; - @else if unitless($size) { - width: $size + px; - height: $size + px; - } - - @else if not(unitless($size)) { - width: $size; - height: $size; - } - } - - // Width x Height - @if length($size) == 2 { - $width: nth($size, 1); + @if length($size) > 1 { $height: nth($size, 2); + } - @if $width == auto { - width: $width; - } - @else if not(unitless($width)) { - width: $width; - } - @else if unitless($width) { - width: $width + px; - } + @if $height == auto or (type-of($height) == number and not unitless($height)) { + height: $height; + } - @if $height == auto { - height: $height; - } - @else if not(unitless($height)) { - height: $height; - } - @else if unitless($height) { - height: $height + px; - } + @if $width == auto or (type-of($width) == number and not unitless($width)) { + width: $width; } } diff --git a/docs/_css/bourbon/addons/_timing-functions.scss b/docs/_css/bourbon/addons/_timing-functions.scss index 51b24109149..5ecc6f9dcf9 100644 --- a/docs/_css/bourbon/addons/_timing-functions.scss +++ b/docs/_css/bourbon/addons/_timing-functions.scss @@ -1,5 +1,5 @@ // CSS cubic-bezier timing functions. Timing functions courtesy of jquery.easie (github.com/jaukia/easie) -// Timing functions are the same as demo'ed here: http://jqueryui.com/demos/effect/easing.html +// Timing functions are the same as demo'ed here: http://jqueryui.com/resources/demos/effect/easing.html // EASE IN $ease-in-quad: cubic-bezier(0.550, 0.085, 0.680, 0.530); diff --git a/docs/_css/bourbon/addons/_triangle.scss b/docs/_css/bourbon/addons/_triangle.scss index 0e02aca2ca5..573954e41e3 100644 --- a/docs/_css/bourbon/addons/_triangle.scss +++ b/docs/_css/bourbon/addons/_triangle.scss @@ -2,44 +2,82 @@ height: 0; width: 0; + $width: nth($size, 1); + $height: nth($size, length($size)); + + $foreground-color: nth($color, 1); + $background-color: if(length($color) == 2, nth($color, 2), transparent); + @if ($direction == up) or ($direction == down) or ($direction == right) or ($direction == left) { - border-color: transparent; - border-style: solid; - border-width: $size / 2; + + $width: $width / 2; + $height: if(length($size) > 1, $height, $height/2); @if $direction == up { - border-bottom-color: $color; + border-left: $width solid $background-color; + border-right: $width solid $background-color; + border-bottom: $height solid $foreground-color; } @else if $direction == right { - border-left-color: $color; + border-top: $width solid $background-color; + border-bottom: $width solid $background-color; + border-left: $height solid $foreground-color; } @else if $direction == down { - border-top-color: $color; + border-left: $width solid $background-color; + border-right: $width solid $background-color; + border-top: $height solid $foreground-color; } @else if $direction == left { - border-right-color: $color; + border-top: $width solid $background-color; + border-bottom: $width solid $background-color; + border-right: $height solid $foreground-color; } } @else if ($direction == up-right) or ($direction == up-left) { - border-top: $size solid $color; + border-top: $height solid $foreground-color; @if $direction == up-right { - border-left: $size solid transparent; + border-left: $width solid $background-color; } @else if $direction == up-left { - border-right: $size solid transparent; + border-right: $width solid $background-color; } } @else if ($direction == down-right) or ($direction == down-left) { - border-bottom: $size solid $color; + border-bottom: $height solid $foreground-color; @if $direction == down-right { - border-left: $size solid transparent; + border-left: $width solid $background-color; } @else if $direction == down-left { - border-right: $size solid transparent; + border-right: $width solid $background-color; } } + + @else if ($direction == inset-up) { + border-width: $height $width; + border-style: solid; + border-color: $background-color $background-color $foreground-color; + } + + @else if ($direction == inset-down) { + border-width: $height $width; + border-style: solid; + border-color: $foreground-color $background-color $background-color; + } + + @else if ($direction == inset-right) { + border-width: $width $height; + border-style: solid; + border-color: $background-color $background-color $background-color $foreground-color; + } + + @else if ($direction == inset-left) { + border-width: $width $height; + border-style: solid; + border-color: $background-color $foreground-color $background-color $background-color; + } } diff --git a/docs/_css/bourbon/addons/_word-wrap.scss b/docs/_css/bourbon/addons/_word-wrap.scss new file mode 100644 index 00000000000..9734a597cd0 --- /dev/null +++ b/docs/_css/bourbon/addons/_word-wrap.scss @@ -0,0 +1,8 @@ +@mixin word-wrap($wrap: break-word) { + word-wrap: $wrap; + + @if $wrap == break-word { + overflow-wrap: break-word; + word-break: break-all; + } +} diff --git a/docs/_css/bourbon/css3/_background-image.scss b/docs/_css/bourbon/css3/_background-image.scss index 17016b91b9c..6abe88be9a5 100644 --- a/docs/_css/bourbon/css3/_background-image.scss +++ b/docs/_css/bourbon/css3/_background-image.scss @@ -4,45 +4,39 @@ //************************************************************************// @mixin background-image($images...) { - background-image: _add-prefix($images, webkit); - background-image: _add-prefix($images); -} + $webkit-images: (); + $spec-images: (); + + @each $image in $images { + $webkit-image: (); + $spec-image: (); + + @if (type-of($image) == string) { + $url-str: str-slice($image, 0, 3); + $gradient-type: str-slice($image, 0, 6); -@function _add-prefix($images, $vendor: false) { - $images-prefixed: (); - $gradient-positions: false; - @for $i from 1 through length($images) { - $type: type-of(nth($images, $i)); // Get type of variable - List or String - - // If variable is a list - Gradient - @if $type == list { - $gradient-type: nth(nth($images, $i), 1); // linear or radial - $gradient-pos: null; - $gradient-args: null; - - @if ($gradient-type == linear) or ($gradient-type == radial) { - $gradient-pos: nth(nth($images, $i), 2); // Get gradient position - $gradient-args: nth(nth($images, $i), 3); // Get actual gradient (red, blue) + @if $url-str == "url" { + $webkit-image: $image; + $spec-image: $image; } - @else { - $gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue) + + @else if $gradient-type == "linear" { + $gradients: _linear-gradient-parser($image); + $webkit-image: map-get($gradients, webkit-image); + $spec-image: map-get($gradients, spec-image); } - $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); - $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); - $images-prefixed: append($images-prefixed, $gradient, comma); - } - // If variable is a string - Image - @else if $type == string { - $images-prefixed: join($images-prefixed, nth($images, $i), comma); + @else if $gradient-type == "radial" { + $gradients: _radial-gradient-parser($image); + $webkit-image: map-get($gradients, webkit-image); + $spec-image: map-get($gradients, spec-image); + } } + + $webkit-images: append($webkit-images, $webkit-image, comma); + $spec-images: append($spec-images, $spec-image, comma); } - @return $images-prefixed; -} -//Examples: - //@include background-image(linear-gradient(top, orange, red)); - //@include background-image(radial-gradient(50% 50%, cover circle, orange, red)); - //@include background-image(url("/images/a.png"), linear-gradient(orange, red)); - //@include background-image(url("image.png"), linear-gradient(orange, red), url("image.png")); - //@include background-image(linear-gradient(hsla(0, 100%, 100%, 0.25) 0%, hsla(0, 100%, 100%, 0.08) 50%, transparent 50%), linear-gradient(orange, red)); + background-image: $webkit-images; + background-image: $spec-images; +} diff --git a/docs/_css/bourbon/css3/_background.scss b/docs/_css/bourbon/css3/_background.scss index 766d5d32247..9bce9308bf9 100644 --- a/docs/_css/bourbon/css3/_background.scss +++ b/docs/_css/bourbon/css3/_background.scss @@ -3,101 +3,53 @@ // notation. //************************************************************************// -@mixin background( - $background-1 , $background-2: false, - $background-3: false, $background-4: false, - $background-5: false, $background-6: false, - $background-7: false, $background-8: false, - $background-9: false, $background-10: false, - $fallback: false -) { - $backgrounds: compact($background-1, $background-2, - $background-3, $background-4, - $background-5, $background-6, - $background-7, $background-8, - $background-9, $background-10); +@mixin background($backgrounds...) { + $webkit-backgrounds: (); + $spec-backgrounds: (); - $fallback-color: false; - @if (type-of($fallback) == color) or ($fallback == "transparent") { - $fallback-color: $fallback; - } - @else { - $fallback-color: _extract-background-color($backgrounds); - } - - @if $fallback-color { - background-color: $fallback-color; - } - background: _background-add-prefix($backgrounds, webkit); - background: _background-add-prefix($backgrounds); -} - -@function _extract-background-color($backgrounds) { - $final-bg-layer: nth($backgrounds, length($backgrounds)); - @if type-of($final-bg-layer) == list { - @for $i from 1 through length($final-bg-layer) { - $value: nth($final-bg-layer, $i); - @if type-of($value) == color { - @return $value; - } - } - } - @return false; -} - -@function _background-add-prefix($backgrounds, $vendor: false) { - $backgrounds-prefixed: (); + @each $background in $backgrounds { + $webkit-background: (); + $spec-background: (); + $background-type: type-of($background); - @for $i from 1 through length($backgrounds) { - $shorthand: nth($backgrounds, $i); // Get member for current index - $type: type-of($shorthand); // Get type of variable - List (gradient) or String (image) + @if $background-type == string or list { + $background-str: if($background-type == list, nth($background, 1), $background); - // If shorthand is a list (gradient) - @if $type == list { - $first-member: nth($shorthand, 1); // Get first member of shorthand + $url-str: str-slice($background-str, 0, 3); + $gradient-type: str-slice($background-str, 0, 6); - // Linear Gradient - @if index(linear radial, nth($first-member, 1)) { - $gradient-type: nth($first-member, 1); // linear || radial - $gradient-args: false; - $gradient-positions: false; - $shorthand-start: false; - @if type-of($first-member) == list { // Linear gradient plus additional shorthand values - lg(red,orange)repeat,... - $gradient-positions: nth($first-member, 2); - $gradient-args: nth($first-member, 3); - $shorthand-start: 2; - } - @else { // Linear gradient only - lg(red,orange),... - $gradient-positions: nth($shorthand, 2); - $gradient-args: nth($shorthand, 3); // Get gradient (red, blue) - } + @if $url-str == "url" { + $webkit-background: $background; + $spec-background: $background; + } - $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-positions); - $gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + @else if $gradient-type == "linear" { + $gradients: _linear-gradient-parser("#{$background}"); + $webkit-background: map-get($gradients, webkit-image); + $spec-background: map-get($gradients, spec-image); + } - // Append any additional shorthand args to gradient - @if $shorthand-start { - @for $j from $shorthand-start through length($shorthand) { - $gradient: join($gradient, nth($shorthand, $j), space); - } - } - $backgrounds-prefixed: append($backgrounds-prefixed, $gradient, comma); + @else if $gradient-type == "radial" { + $gradients: _radial-gradient-parser("#{$background}"); + $webkit-background: map-get($gradients, webkit-image); + $spec-background: map-get($gradients, spec-image); } - // Image with additional properties + @else { - $backgrounds-prefixed: append($backgrounds-prefixed, $shorthand, comma); + $webkit-background: $background; + $spec-background: $background; } } - // If shorthand is a simple string (color or image) - @else if $type == string { - $backgrounds-prefixed: join($backgrounds-prefixed, $shorthand, comma); + + @else { + $webkit-background: $background; + $spec-background: $background; } + + $webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma); + $spec-backgrounds: append($spec-backgrounds, $spec-background, comma); } - @return $backgrounds-prefixed; -} -//Examples: - //@include background(linear-gradient(top, orange, red)); - //@include background(radial-gradient(circle at 40% 40%, orange, red)); - //@include background(url("/images/a.png") no-repeat, linear-gradient(orange, red)); - //@include background(url("image.png") center center, linear-gradient(orange, red), url("image.png")); + background: $webkit-backgrounds; + background: $spec-backgrounds; +} diff --git a/docs/_css/bourbon/css3/_border-image.scss b/docs/_css/bourbon/css3/_border-image.scss index 1fff212df8a..e338c2dcd24 100644 --- a/docs/_css/bourbon/css3/_border-image.scss +++ b/docs/_css/bourbon/css3/_border-image.scss @@ -1,48 +1,53 @@ -@mixin border-image($images) { - -webkit-border-image: _border-add-prefix($images, webkit); - -moz-border-image: _border-add-prefix($images, moz); - -o-border-image: _border-add-prefix($images, o); - border-image: _border-add-prefix($images); -} +@mixin border-image($borders...) { + $webkit-borders: (); + $spec-borders: (); + + @each $border in $borders { + $webkit-border: (); + $spec-border: (); + $border-type: type-of($border); + + @if $border-type == string or list { + $border-str: if($border-type == list, nth($border, 1), $border); + + $url-str: str-slice($border-str, 0, 3); + $gradient-type: str-slice($border-str, 0, 6); + + @if $url-str == "url" { + $webkit-border: $border; + $spec-border: $border; + } + + @else if $gradient-type == "linear" { + $gradients: _linear-gradient-parser("#{$border}"); + $webkit-border: map-get($gradients, webkit-image); + $spec-border: map-get($gradients, spec-image); + } + + @else if $gradient-type == "radial" { + $gradients: _radial-gradient-parser("#{$border}"); + $webkit-border: map-get($gradients, webkit-image); + $spec-border: map-get($gradients, spec-image); + } -@function _border-add-prefix($images, $vendor: false) { - $border-image: null; - $images-type: type-of(nth($images, 1)); - $first-var: nth(nth($images, 1), 1); // Get type of Gradient (Linear || radial) - - // If input is a gradient - @if $images-type == string { - @if ($first-var == "linear") or ($first-var == "radial") { - $gradient-type: nth($images, 1); // Get type of gradient (linear || radial) - $gradient-pos: nth($images, 2); // Get gradient position - $gradient-args: nth($images, 3); // Get actual gradient (red, blue) - $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); - $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); + @else { + $webkit-border: $border; + $spec-border: $border; + } } - // If input is a URL + @else { - $border-image: $images; - } - } - // If input is gradient or url + additional args - @else if $images-type == list { - $type: type-of(nth($images, 1)); // Get type of variable - List or String - - // If variable is a list - Gradient - @if $type == list { - $gradient: nth($images, 1); - $gradient-type: nth($gradient, 1); // Get type of gradient (linear || radial) - $gradient-pos: nth($gradient, 2); // Get gradient position - $gradient-args: nth($gradient, 3); // Get actual gradient (red, blue) - $gradient-positions: _gradient-positions-parser($gradient-type, $gradient-pos); - $border-image: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor); - - @for $i from 2 through length($images) { - $border-image: append($border-image, nth($images, $i)); - } + $webkit-border: $border; + $spec-border: $border; } + + $webkit-borders: append($webkit-borders, $webkit-border, comma); + $spec-borders: append($spec-borders, $spec-border, comma); } - @return $border-image; + + -webkit-border-image: $webkit-borders; + border-image: $spec-borders; + border-style: solid; } //Examples: @@ -52,4 +57,3 @@ // @include border-image(linear-gradient(45deg, orange, yellow) stretch); // @include border-image(linear-gradient(45deg, orange, yellow) 20 30 40 50 stretch round); // @include border-image(radial-gradient(top, cover, orange, yellow, orange)); - diff --git a/docs/_css/bourbon/css3/_calc.scss b/docs/_css/bourbon/css3/_calc.scss new file mode 100644 index 00000000000..94d7e4cef3c --- /dev/null +++ b/docs/_css/bourbon/css3/_calc.scss @@ -0,0 +1,4 @@ +@mixin calc($property, $value) { + #{$property}: -webkit-calc(#{$value}); + #{$property}: calc(#{$value}); +} diff --git a/docs/_css/bourbon/css3/_columns.scss b/docs/_css/bourbon/css3/_columns.scss index 42274a4eebb..96f601c1a81 100644 --- a/docs/_css/bourbon/css3/_columns.scss +++ b/docs/_css/bourbon/css3/_columns.scss @@ -15,7 +15,7 @@ @mixin column-fill($arg: auto) { // auto || length - @include prefixer(columns-fill, $arg, webkit moz spec); + @include prefixer(column-fill, $arg, webkit moz spec); } @mixin column-rule($arg) { diff --git a/docs/_css/bourbon/css3/_filter.scss b/docs/_css/bourbon/css3/_filter.scss new file mode 100644 index 00000000000..8560d77676d --- /dev/null +++ b/docs/_css/bourbon/css3/_filter.scss @@ -0,0 +1,5 @@ +@mixin filter($function: none) { + // [= 1 { - @include prefixer(transition, $properties, webkit moz spec); + // Fix for vendor-prefix transform property + $needs-prefixes: false; + $webkit: (); + $moz: (); + $spec: (); + + // Create lists for vendor-prefixed transform + @each $list in $properties { + @if nth($list, 1) == "transform" { + $needs-prefixes: true; + $list1: -webkit-transform; + $list2: -moz-transform; + $list3: (); + + @each $var in $list { + $list3: join($list3, $var); + + @if $var != "transform" { + $list1: join($list1, $var); + $list2: join($list2, $var); + } + } + + $webkit: append($webkit, $list1); + $moz: append($moz, $list2); + $spec: append($spec, $list3); + } + + // Create lists for non-prefixed transition properties + @else { + $webkit: append($webkit, $list, comma); + $moz: append($moz, $list, comma); + $spec: append($spec, $list, comma); + } } + @if $needs-prefixes { + -webkit-transition: $webkit; + -moz-transition: $moz; + transition: $spec; + } @else { - $properties: all 0.15s ease-out 0; - @include prefixer(transition, $properties, webkit moz spec); + @if length($properties) >= 1 { + @include prefixer(transition, $properties, webkit moz spec); + } + + @else { + $properties: all 0.15s ease-out 0s; + @include prefixer(transition, $properties, webkit moz spec); + } } } diff --git a/docs/_css/bourbon/functions/_assign.scss b/docs/_css/bourbon/functions/_assign.scss new file mode 100644 index 00000000000..9a1db93ef74 --- /dev/null +++ b/docs/_css/bourbon/functions/_assign.scss @@ -0,0 +1,11 @@ +@function assign-inputs($inputs, $pseudo: null) { + $list : (); + + @each $input in $inputs { + $input: unquote($input); + $input: if($pseudo, $input + ":" + $pseudo, $input); + $list: append($list, $input, comma); + } + + @return $list; +} \ No newline at end of file diff --git a/docs/_css/bourbon/functions/_color-lightness.scss b/docs/_css/bourbon/functions/_color-lightness.scss new file mode 100644 index 00000000000..8c6df4e2564 --- /dev/null +++ b/docs/_css/bourbon/functions/_color-lightness.scss @@ -0,0 +1,13 @@ +// Programatically determines whether a color is light or dark +// Returns a boolean +// More details here http://robots.thoughtbot.com/closer-look-color-lightness + +@function is-light($hex-color) { + $-local-red: red(rgba($hex-color, 1.0)); + $-local-green: green(rgba($hex-color, 1.0)); + $-local-blue: blue(rgba($hex-color, 1.0)); + + $-local-lightness: ($-local-red * 0.2126 + $-local-green * 0.7152 + $-local-blue * 0.0722) / 255; + + @return $-local-lightness > .6; +} diff --git a/docs/_css/bourbon/functions/_compact.scss b/docs/_css/bourbon/functions/_compact.scss deleted file mode 100644 index 871500e3394..00000000000 --- a/docs/_css/bourbon/functions/_compact.scss +++ /dev/null @@ -1,11 +0,0 @@ -// Remove `false` values from a list - -@function compact($vars...) { - $list: (); - @each $var in $vars { - @if $var { - $list: append($list, $var, comma); - } - } - @return $list; -} diff --git a/docs/_css/bourbon/functions/_golden-ratio.scss b/docs/_css/bourbon/functions/_golden-ratio.scss new file mode 100644 index 00000000000..463d14a00c1 --- /dev/null +++ b/docs/_css/bourbon/functions/_golden-ratio.scss @@ -0,0 +1,3 @@ +@function golden-ratio($value, $increment) { + @return modular-scale($value, $increment, $golden) +} diff --git a/docs/_css/bourbon/functions/_linear-gradient.scss b/docs/_css/bourbon/functions/_linear-gradient.scss deleted file mode 100644 index c8454d83f08..00000000000 --- a/docs/_css/bourbon/functions/_linear-gradient.scss +++ /dev/null @@ -1,13 +0,0 @@ -@function linear-gradient($pos, $gradients...) { - $type: linear; - $pos-type: type-of(nth($pos, 1)); - - // if $pos doesn't exist, fix $gradient - @if ($pos-type == color) or (nth($pos, 1) == "transparent") { - $gradients: zip($pos $gradients); - $pos: false; - } - - $type-gradient: $type, $pos, $gradients; - @return $type-gradient; -} diff --git a/docs/_css/bourbon/functions/_modular-scale.scss b/docs/_css/bourbon/functions/_modular-scale.scss index dddccb52241..afc59eb954d 100644 --- a/docs/_css/bourbon/functions/_modular-scale.scss +++ b/docs/_css/bourbon/functions/_modular-scale.scss @@ -1,40 +1,66 @@ +// Scaling Variables +$golden: 1.618; +$minor-second: 1.067; +$major-second: 1.125; +$minor-third: 1.2; +$major-third: 1.25; +$perfect-fourth: 1.333; +$augmented-fourth: 1.414; +$perfect-fifth: 1.5; +$minor-sixth: 1.6; +$major-sixth: 1.667; +$minor-seventh: 1.778; +$major-seventh: 1.875; +$octave: 2; +$major-tenth: 2.5; +$major-eleventh: 2.667; +$major-twelfth: 3; +$double-octave: 4; + @function modular-scale($value, $increment, $ratio) { + $v1: nth($value, 1); + $v2: nth($value, length($value)); + $value: $v1; + + // scale $v2 to just above $v1 + @while $v2 > $v1 { + $v2: ($v2 / $ratio); // will be off-by-1 + } + @while $v2 < $v1 { + $v2: ($v2 * $ratio); // will fix off-by-1 + } + + // check AFTER scaling $v2 to prevent double-counting corner-case + $double-stranded: $v2 > $v1; + @if $increment > 0 { @for $i from 1 through $increment { - $value: ($value * $ratio); + @if $double-stranded and ($v1 * $ratio) > $v2 { + $value: $v2; + $v2: ($v2 * $ratio); + } @else { + $v1: ($v1 * $ratio); + $value: $v1; + } } } @if $increment < 0 { - $increment: abs($increment); - @for $i from 1 through $increment { - $value: ($value / $ratio); + // adjust $v2 to just below $v1 + @if $double-stranded { + $v2: ($v2 / $ratio); + } + + @for $i from $increment through -1 { + @if $double-stranded and ($v1 / $ratio) < $v2 { + $value: $v2; + $v2: ($v2 / $ratio); + } @else { + $v1: ($v1 / $ratio); + $value: $v1; + } } } @return $value; } - -// div { -// Increment Up GR with positive value -// font-size: modular-scale(14px, 1, 1.618); // returns: 22.652px -// -// Increment Down GR with negative value -// font-size: modular-scale(14px, -1, 1.618); // returns: 8.653px -// -// Can be used with ceil(round up) or floor(round down) -// font-size: floor( modular-scale(14px, 1, 1.618) ); // returns: 22px -// font-size: ceil( modular-scale(14px, 1, 1.618) ); // returns: 23px -// } -// -// modularscale.com - -@function golden-ratio($value, $increment) { - @return modular-scale($value, $increment, 1.618) -} - -// div { -// font-size: golden-ratio(14px, 1); // returns: 22.652px -// } -// -// goldenratiocalculator.com diff --git a/docs/_css/bourbon/functions/_px-to-em.scss b/docs/_css/bourbon/functions/_px-to-em.scss index 2eb1031c60e..4832245e455 100644 --- a/docs/_css/bourbon/functions/_px-to-em.scss +++ b/docs/_css/bourbon/functions/_px-to-em.scss @@ -2,7 +2,12 @@ // eg. for a relational value of 12px write em(12) when the parent is 16px // if the parent is another value say 24px write em(12, 24) -@function em($pxval, $base: 16) { +@function em($pxval, $base: $em-base) { + @if not unitless($pxval) { + $pxval: strip-units($pxval); + } + @if not unitless($base) { + $base: strip-units($base); + } @return ($pxval / $base) * 1em; } - diff --git a/docs/_css/bourbon/functions/_px-to-rem.scss b/docs/_css/bourbon/functions/_px-to-rem.scss new file mode 100644 index 00000000000..96b244e4cb1 --- /dev/null +++ b/docs/_css/bourbon/functions/_px-to-rem.scss @@ -0,0 +1,15 @@ +// Convert pixels to rems +// eg. for a relational value of 12px write rem(12) +// Assumes $em-base is the font-size of + +@function rem($pxval) { + @if not unitless($pxval) { + $pxval: strip-units($pxval); + } + + $base: $em-base; + @if not unitless($base) { + $base: strip-units($base); + } + @return ($pxval / $base) * 1rem; +} diff --git a/docs/_css/bourbon/functions/_radial-gradient.scss b/docs/_css/bourbon/functions/_radial-gradient.scss deleted file mode 100644 index 75584060d2a..00000000000 --- a/docs/_css/bourbon/functions/_radial-gradient.scss +++ /dev/null @@ -1,23 +0,0 @@ -// This function is required and used by the background-image mixin. -@function radial-gradient($G1, $G2, - $G3: false, $G4: false, - $G5: false, $G6: false, - $G7: false, $G8: false, - $G9: false, $G10: false, - $pos: null, - $shape-size: null) { - - $data: _radial-arg-parser($G1, $G2, $pos, $shape-size); - $G1: nth($data, 1); - $G2: nth($data, 2); - $pos: nth($data, 3); - $shape-size: nth($data, 4); - - $type: radial; - $gradient: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10); - - $type-gradient: $type, $shape-size $pos, $gradient; - @return $type-gradient; -} - - diff --git a/docs/_css/bourbon/functions/_strip-units.scss b/docs/_css/bourbon/functions/_strip-units.scss new file mode 100644 index 00000000000..6afc6e601c0 --- /dev/null +++ b/docs/_css/bourbon/functions/_strip-units.scss @@ -0,0 +1,5 @@ +// Srtips the units from a value. e.g. 12px -> 12 + +@function strip-units($val) { + @return ($val / ($val * 0 + 1)); +} diff --git a/docs/_css/bourbon/functions/_unpack.scss b/docs/_css/bourbon/functions/_unpack.scss new file mode 100644 index 00000000000..377596365c8 --- /dev/null +++ b/docs/_css/bourbon/functions/_unpack.scss @@ -0,0 +1,17 @@ +// Convert shorthand to the 4-value syntax + +@function unpack($shorthand) { + @if length($shorthand) == 1 { + @return nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1) nth($shorthand, 1); + } + @else if length($shorthand) == 2 { + @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 1) nth($shorthand, 2); + } + @else if length($shorthand) == 3 { + @return nth($shorthand, 1) nth($shorthand, 2) nth($shorthand, 3) nth($shorthand, 2); + } + @else { + @return $shorthand; + } +} + diff --git a/docs/_css/bourbon/helpers/_convert-units.scss b/docs/_css/bourbon/helpers/_convert-units.scss new file mode 100644 index 00000000000..3443db397c2 --- /dev/null +++ b/docs/_css/bourbon/helpers/_convert-units.scss @@ -0,0 +1,15 @@ +//************************************************************************// +// Helper function for str-to-num fn. +// Source: http://sassmeister.com/gist/9647408 +//************************************************************************// +@function _convert-units($number, $unit) { + $strings: 'px' 'cm' 'mm' '%' 'ch' 'pica' 'in' 'em' 'rem' 'pt' 'pc' 'ex' 'vw' 'vh' 'vmin' 'vmax', 'deg', 'rad', 'grad', 'turn'; + $units: 1px 1cm 1mm 1% 1ch 1pica 1in 1em 1rem 1pt 1pc 1ex 1vw 1vh 1vmin 1vmax, 1deg, 1rad, 1grad, 1turn; + $index: index($strings, $unit); + + @if not $index { + @warn "Unknown unit `#{$unit}`."; + @return false; + } + @return $number * nth($units, $index); +} diff --git a/docs/_css/bourbon/helpers/_deprecated-webkit-gradient.scss b/docs/_css/bourbon/helpers/_deprecated-webkit-gradient.scss deleted file mode 100644 index cd17e2832da..00000000000 --- a/docs/_css/bourbon/helpers/_deprecated-webkit-gradient.scss +++ /dev/null @@ -1,39 +0,0 @@ -// Render Deprecated Webkit Gradient - Linear || Radial -//************************************************************************// -@function _deprecated-webkit-gradient($type, - $deprecated-pos1, $deprecated-pos2, - $full, - $deprecated-radius1: false, $deprecated-radius2: false) { - $gradient-list: (); - $gradient: false; - $full-length: length($full); - $percentage: false; - $gradient-type: $type; - - @for $i from 1 through $full-length { - $gradient: nth($full, $i); - - @if length($gradient) == 2 { - $color-stop: color-stop(nth($gradient, 2), nth($gradient, 1)); - $gradient-list: join($gradient-list, $color-stop, comma); - } - @else if $gradient != null { - @if $i == $full-length { - $percentage: 100%; - } - @else { - $percentage: ($i - 1) * (100 / ($full-length - 1)) + "%"; - } - $color-stop: color-stop(unquote($percentage), $gradient); - $gradient-list: join($gradient-list, $color-stop, comma); - } - } - - @if $type == radial { - $gradient: -webkit-gradient(radial, $deprecated-pos1, $deprecated-radius1, $deprecated-pos2, $deprecated-radius2, $gradient-list); - } - @else if $type == linear { - $gradient: -webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $gradient-list); - } - @return $gradient; -} diff --git a/docs/_css/bourbon/helpers/_is-num.scss b/docs/_css/bourbon/helpers/_is-num.scss new file mode 100644 index 00000000000..71459e1404a --- /dev/null +++ b/docs/_css/bourbon/helpers/_is-num.scss @@ -0,0 +1,8 @@ +//************************************************************************// +// Helper for linear-gradient-parser +//************************************************************************// +@function _is-num($char) { + $values: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' 0 1 2 3 4 5 6 7 8 9; + $index: index($values, $char); + @return if($index, true, false); +} diff --git a/docs/_css/bourbon/helpers/_linear-angle-parser.scss b/docs/_css/bourbon/helpers/_linear-angle-parser.scss new file mode 100644 index 00000000000..e0401ed8df1 --- /dev/null +++ b/docs/_css/bourbon/helpers/_linear-angle-parser.scss @@ -0,0 +1,25 @@ +// Private function for linear-gradient-parser +@function _linear-angle-parser($image, $first-val, $prefix, $suffix) { + $offset: null; + $unit-short: str-slice($first-val, str-length($first-val) - 2, str-length($first-val)); + $unit-long: str-slice($first-val, str-length($first-val) - 3, str-length($first-val)); + + @if ($unit-long == "grad") or + ($unit-long == "turn") { + $offset: if($unit-long == "grad", -100grad * 3, -0.75turn); + } + + @else if ($unit-short == "deg") or + ($unit-short == "rad") { + $offset: if($unit-short == "deg", -90 * 3, 1.6rad); + } + + @if $offset { + $num: _str-to-num($first-val); + + @return ( + webkit-image: -webkit- + $prefix + ($offset - $num) + $suffix, + spec-image: $image + ); + } +} diff --git a/docs/_css/bourbon/helpers/_linear-gradient-parser.scss b/docs/_css/bourbon/helpers/_linear-gradient-parser.scss new file mode 100644 index 00000000000..12bcdcda8fd --- /dev/null +++ b/docs/_css/bourbon/helpers/_linear-gradient-parser.scss @@ -0,0 +1,41 @@ +@function _linear-gradient-parser($image) { + $image: unquote($image); + $gradients: (); + $start: str-index($image, "("); + $end: str-index($image, ","); + $first-val: str-slice($image, $start + 1, $end - 1); + + $prefix: str-slice($image, 0, $start); + $suffix: str-slice($image, $end, str-length($image)); + + $has-multiple-vals: str-index($first-val, " "); + $has-single-position: unquote(_position-flipper($first-val) + ""); + $has-angle: _is-num(str-slice($first-val, 0, 0)); + + @if $has-multiple-vals { + $gradients: _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals); + } + + @else if $has-single-position != "" { + $pos: unquote($has-single-position + ""); + + $gradients: ( + webkit-image: -webkit- + $image, + spec-image: $prefix + "to " + $pos + $suffix + ); + } + + @else if $has-angle { + // Rotate degree for webkit + $gradients: _linear-angle-parser($image, $first-val, $prefix, $suffix); + } + + @else { + $gradients: ( + webkit-image: -webkit- + $image, + spec-image: $image + ); + } + + @return $gradients; +} diff --git a/docs/_css/bourbon/helpers/_linear-side-corner-parser.scss b/docs/_css/bourbon/helpers/_linear-side-corner-parser.scss new file mode 100644 index 00000000000..86ad88fbb7d --- /dev/null +++ b/docs/_css/bourbon/helpers/_linear-side-corner-parser.scss @@ -0,0 +1,31 @@ +// Private function for linear-gradient-parser +@function _linear-side-corner-parser($image, $first-val, $prefix, $suffix, $has-multiple-vals) { + $val-1: str-slice($first-val, 0, $has-multiple-vals - 1 ); + $val-2: str-slice($first-val, $has-multiple-vals + 1, str-length($first-val)); + $val-3: null; + $has-val-3: str-index($val-2, " "); + + @if $has-val-3 { + $val-3: str-slice($val-2, $has-val-3 + 1, str-length($val-2)); + $val-2: str-slice($val-2, 0, $has-val-3 - 1); + } + + $pos: _position-flipper($val-1) _position-flipper($val-2) _position-flipper($val-3); + $pos: unquote($pos + ""); + + // Use old spec for webkit + @if $val-1 == "to" { + @return ( + webkit-image: -webkit- + $prefix + $pos + $suffix, + spec-image: $image + ); + } + + // Bring the code up to spec + @else { + @return ( + webkit-image: -webkit- + $image, + spec-image: $prefix + "to " + $pos + $suffix + ); + } +} diff --git a/docs/_css/bourbon/helpers/_radial-arg-parser.scss b/docs/_css/bourbon/helpers/_radial-arg-parser.scss index 3466695bdfb..a3a3704af5e 100644 --- a/docs/_css/bourbon/helpers/_radial-arg-parser.scss +++ b/docs/_css/bourbon/helpers/_radial-arg-parser.scss @@ -22,7 +22,7 @@ $pos: $pos nth($value, $i); } } - $G1: false; + $G1: null; } // If not spec calculate correct values @@ -38,7 +38,7 @@ $pos: $value; @if $pos == $G1 { - $G1: false; + $G1: null; } } @@ -55,11 +55,11 @@ $shape-size: $value; @if $value == $G1 { - $G1: false; + $G1: null; } @else if $value == $G2 { - $G2: false; + $G2: null; } } } diff --git a/docs/_css/bourbon/helpers/_radial-gradient-parser.scss b/docs/_css/bourbon/helpers/_radial-gradient-parser.scss new file mode 100644 index 00000000000..6dde50f0640 --- /dev/null +++ b/docs/_css/bourbon/helpers/_radial-gradient-parser.scss @@ -0,0 +1,50 @@ +@function _radial-gradient-parser($image) { + $image: unquote($image); + $gradients: (); + $start: str-index($image, "("); + $end: str-index($image, ","); + $first-val: str-slice($image, $start + 1, $end - 1); + + $prefix: str-slice($image, 0, $start); + $suffix: str-slice($image, $end, str-length($image)); + + $is-spec-syntax: str-index($first-val, "at"); + + @if $is-spec-syntax and $is-spec-syntax > 1 { + $keyword: str-slice($first-val, 1, $is-spec-syntax - 2); + $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val)); + $pos: append($pos, $keyword, comma); + + $gradients: ( + webkit-image: -webkit- + $prefix + $pos + $suffix, + spec-image: $image + ) + } + + @else if $is-spec-syntax == 1 { + $pos: str-slice($first-val, $is-spec-syntax + 3, str-length($first-val)); + + $gradients: ( + webkit-image: -webkit- + $prefix + $pos + $suffix, + spec-image: $image + ) + } + + @else if str-index($image, "cover") or str-index($image, "contain") { + @warn "Radial-gradient needs to be updated to conform to latest spec."; + + $gradients: ( + webkit-image: null, + spec-image: $image + ) + } + + @else { + $gradients: ( + webkit-image: -webkit- + $image, + spec-image: $image + ) + } + + @return $gradients; +} diff --git a/docs/_css/bourbon/helpers/_str-to-num.scss b/docs/_css/bourbon/helpers/_str-to-num.scss new file mode 100644 index 00000000000..b3d616824d3 --- /dev/null +++ b/docs/_css/bourbon/helpers/_str-to-num.scss @@ -0,0 +1,50 @@ +//************************************************************************// +// Helper function for linear/radial-gradient-parsers. +// Source: http://sassmeister.com/gist/9647408 +//************************************************************************// +@function _str-to-num($string) { + // Matrices + $strings: '0' '1' '2' '3' '4' '5' '6' '7' '8' '9'; + $numbers: 0 1 2 3 4 5 6 7 8 9; + + // Result + $result: 0; + $divider: 0; + $minus: false; + + // Looping through all characters + @for $i from 1 through str-length($string) { + $character: str-slice($string, $i, $i); + $index: index($strings, $character); + + @if $character == '-' { + $minus: true; + } + + @else if $character == '.' { + $divider: 1; + } + + @else { + @if not $index { + $result: if($minus, $result * -1, $result); + @return _convert-units($result, str-slice($string, $i)); + } + + $number: nth($numbers, $index); + + @if $divider == 0 { + $result: $result * 10; + } + + @else { + // Move the decimal dot to the left + $divider: $divider * 10; + $number: $number / $divider; + } + + $result: $result + $number; + } + } + @return if($minus, $result * -1, $result); +} diff --git a/docs/_css/bourbon/settings/_asset-pipeline.scss b/docs/_css/bourbon/settings/_asset-pipeline.scss new file mode 100644 index 00000000000..d481a6afb16 --- /dev/null +++ b/docs/_css/bourbon/settings/_asset-pipeline.scss @@ -0,0 +1 @@ +$asset-pipeline: false !default; diff --git a/docs/_css/bourbon/settings/_prefixer.scss b/docs/_css/bourbon/settings/_prefixer.scss new file mode 100644 index 00000000000..ecab49fb542 --- /dev/null +++ b/docs/_css/bourbon/settings/_prefixer.scss @@ -0,0 +1,6 @@ +// Variable settings for /addons/prefixer.scss +$prefix-for-webkit: true !default; +$prefix-for-mozilla: true !default; +$prefix-for-microsoft: true !default; +$prefix-for-opera: true !default; +$prefix-for-spec: true !default; // required for keyframe mixin diff --git a/docs/_css/bourbon/settings/_px-to-em.scss b/docs/_css/bourbon/settings/_px-to-em.scss new file mode 100644 index 00000000000..f2f9a3e8dee --- /dev/null +++ b/docs/_css/bourbon/settings/_px-to-em.scss @@ -0,0 +1 @@ +$em-base: 16px !default; From 03df215bd2a02b0e787a0ccdd877fa90d1378c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 11:26:04 -0700 Subject: [PATCH 4/8] Default to layout: post for posts Just a little less boilerplate. This also removes a bit of trailing whitespace because it shouldn't have been there. --- docs/_config.yml | 6 ++++++ docs/_posts/2013-06-02-jsfiddle-integration.md | 1 - docs/_posts/2013-06-05-why-react.md | 1 - docs/_posts/2013-06-12-community-roundup.md | 1 - docs/_posts/2013-06-19-community-roundup-2.md | 1 - docs/_posts/2013-06-21-react-v0-3-3.md | 1 - docs/_posts/2013-06-27-community-roundup-3.md | 1 - docs/_posts/2013-07-02-react-v0-4-autobind-by-default.md | 1 - docs/_posts/2013-07-03-community-roundup-4.md | 1 - ...-07-11-react-v0-4-prop-validation-and-default-values.md | 1 - docs/_posts/2013-07-17-react-v0-4-0.md | 1 - docs/_posts/2013-07-23-community-roundup-5.md | 1 - docs/_posts/2013-07-26-react-v0-4-1.md | 1 - .../2013-07-30-use-react-and-jsx-in-ruby-on-rails.md | 1 - docs/_posts/2013-08-05-community-roundup-6.md | 3 +-- .../2013-08-19-use-react-and-jsx-in-python-applications.md | 1 - docs/_posts/2013-08-26-community-roundup-7.md | 1 - docs/_posts/2013-09-24-community-roundup-8.md | 1 - docs/_posts/2013-10-16-react-v0.5.0.md | 1 - docs/_posts/2013-10-29-react-v0-5-1.md | 1 - docs/_posts/2013-10-3-community-roundup-9.md | 1 - docs/_posts/2013-11-05-thinking-in-react.md | 1 - docs/_posts/2013-11-06-community-roundup-10.md | 1 - docs/_posts/2013-11-18-community-roundup-11.md | 3 +-- docs/_posts/2013-12-18-react-v0.5.2-v0.4.2.md | 1 - docs/_posts/2013-12-19-react-v0.8.0.md | 1 - docs/_posts/2013-12-23-community-roundup-12.md | 1 - docs/_posts/2013-12-30-community-roundup-13.md | 1 - docs/_posts/2014-01-02-react-chrome-developer-tools.md | 1 - docs/_posts/2014-01-06-community-roundup-14.md | 1 - docs/_posts/2014-02-05-community-roundup-15.md | 1 - docs/_posts/2014-02-15-community-roundup-16.md | 1 - docs/_posts/2014-02-16-react-v0.9-rc1.md | 1 - docs/_posts/2014-02-20-react-v0.9.md | 1 - docs/_posts/2014-02-24-community-roundup-17.md | 1 - docs/_posts/2014-03-14-community-roundup-18.md | 1 - docs/_posts/2014-03-19-react-v0.10-rc1.md | 1 - docs/_posts/2014-03-21-react-v0.10.md | 1 - docs/_posts/2014-03-28-the-road-to-1.0.md | 1 - docs/_posts/2014-04-04-reactnet.md | 1 - docs/_posts/2014-05-06-flux.md | 1 - docs/_posts/2014-05-29-one-year-of-open-source-react.md | 1 - docs/_posts/2014-06-27-community-roundup-19.md | 1 - docs/_posts/2014-07-13-react-v0.11-rc1.md | 1 - docs/_posts/2014-07-17-react-v0.11.md | 1 - docs/_posts/2014-07-25-react-v0.11.1.md | 1 - docs/_posts/2014-07-28-community-roundup-20.md | 7 +++---- docs/_posts/2014-07-30-flux-actions-and-the-dispatcher.md | 3 +-- docs/_posts/2014-08-03-community-roundup-21.md | 1 - 49 files changed, 12 insertions(+), 54 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index e6bf45c8928..56cc1b31108 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -9,6 +9,12 @@ relative_permalinks: true paginate: 5 timezone: America/Los_Angeles highlighter: pygments +defaults: +- scope: + path: '' + type: post + values: + layout: post exclude: - Gemfile - Gemfile.lock diff --git a/docs/_posts/2013-06-02-jsfiddle-integration.md b/docs/_posts/2013-06-02-jsfiddle-integration.md index 3dbb0547737..51b678d0cb1 100644 --- a/docs/_posts/2013-06-02-jsfiddle-integration.md +++ b/docs/_posts/2013-06-02-jsfiddle-integration.md @@ -1,6 +1,5 @@ --- title: JSFiddle Integration -layout: post author: Christopher Chedeau --- diff --git a/docs/_posts/2013-06-05-why-react.md b/docs/_posts/2013-06-05-why-react.md index 07f02e1ef9a..a459388c686 100644 --- a/docs/_posts/2013-06-05-why-react.md +++ b/docs/_posts/2013-06-05-why-react.md @@ -1,6 +1,5 @@ --- title: Why did we build React? -layout: post author: Pete Hunt --- diff --git a/docs/_posts/2013-06-12-community-roundup.md b/docs/_posts/2013-06-12-community-roundup.md index d37e3b13514..0fea125af08 100644 --- a/docs/_posts/2013-06-12-community-roundup.md +++ b/docs/_posts/2013-06-12-community-roundup.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #1" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-06-19-community-roundup-2.md b/docs/_posts/2013-06-19-community-roundup-2.md index 57b322e1cc7..d04dc5071d1 100644 --- a/docs/_posts/2013-06-19-community-roundup-2.md +++ b/docs/_posts/2013-06-19-community-roundup-2.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #2" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-06-21-react-v0-3-3.md b/docs/_posts/2013-06-21-react-v0-3-3.md index 668c83de1a6..129ed7f844c 100644 --- a/docs/_posts/2013-06-21-react-v0-3-3.md +++ b/docs/_posts/2013-06-21-react-v0-3-3.md @@ -1,6 +1,5 @@ --- title: "React v0.3.3" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-06-27-community-roundup-3.md b/docs/_posts/2013-06-27-community-roundup-3.md index 7ee8a33116c..91b35b6b628 100644 --- a/docs/_posts/2013-06-27-community-roundup-3.md +++ b/docs/_posts/2013-06-27-community-roundup-3.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #3" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-07-02-react-v0-4-autobind-by-default.md b/docs/_posts/2013-07-02-react-v0-4-autobind-by-default.md index 9a5735f7007..29e00b83a80 100644 --- a/docs/_posts/2013-07-02-react-v0-4-autobind-by-default.md +++ b/docs/_posts/2013-07-02-react-v0-4-autobind-by-default.md @@ -1,6 +1,5 @@ --- title: "New in React v0.4: Autobind by Default" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-07-03-community-roundup-4.md b/docs/_posts/2013-07-03-community-roundup-4.md index 62e56c569df..dd78baac4d7 100644 --- a/docs/_posts/2013-07-03-community-roundup-4.md +++ b/docs/_posts/2013-07-03-community-roundup-4.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #4" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-07-11-react-v0-4-prop-validation-and-default-values.md b/docs/_posts/2013-07-11-react-v0-4-prop-validation-and-default-values.md index b2898fd3f41..5e1b191b317 100644 --- a/docs/_posts/2013-07-11-react-v0-4-prop-validation-and-default-values.md +++ b/docs/_posts/2013-07-11-react-v0-4-prop-validation-and-default-values.md @@ -1,6 +1,5 @@ --- title: "New in React v0.4: Prop Validation and Default Values" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-07-17-react-v0-4-0.md b/docs/_posts/2013-07-17-react-v0-4-0.md index b2a11fcdad0..a42b5e55ab7 100644 --- a/docs/_posts/2013-07-17-react-v0-4-0.md +++ b/docs/_posts/2013-07-17-react-v0-4-0.md @@ -1,6 +1,5 @@ --- title: "React v0.4.0" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-07-23-community-roundup-5.md b/docs/_posts/2013-07-23-community-roundup-5.md index 87aa8338e04..ff39aa06b5e 100644 --- a/docs/_posts/2013-07-23-community-roundup-5.md +++ b/docs/_posts/2013-07-23-community-roundup-5.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #5" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-07-26-react-v0-4-1.md b/docs/_posts/2013-07-26-react-v0-4-1.md index 7111e0e80ef..96c68c3321e 100644 --- a/docs/_posts/2013-07-26-react-v0-4-1.md +++ b/docs/_posts/2013-07-26-react-v0-4-1.md @@ -1,6 +1,5 @@ --- title: "React v0.4.1" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md b/docs/_posts/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md index 608da381ced..c8ccc4a6d9d 100644 --- a/docs/_posts/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md +++ b/docs/_posts/2013-07-30-use-react-and-jsx-in-ruby-on-rails.md @@ -1,6 +1,5 @@ --- title: "Use React and JSX in Ruby on Rails" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-08-05-community-roundup-6.md b/docs/_posts/2013-08-05-community-roundup-6.md index a038136b565..9dec9e03997 100644 --- a/docs/_posts/2013-08-05-community-roundup-6.md +++ b/docs/_posts/2013-08-05-community-roundup-6.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #6" -layout: post author: Vjeux --- @@ -58,7 +57,7 @@ este.demos.react.todoApp = este.react.create (`/** @lends {React.ReactComponent. [Zaim Bakar](http://zaim.github.io/) shared his boilerplate to get started with Stylus CSS processor. > This is my boilerplate React project using Grunt as the build tool, and Stylus as my CSS preprocessor. -> +> > - Very minimal HTML boilerplate > - Uses Stylus, with nib included > - Uses two build targets: diff --git a/docs/_posts/2013-08-19-use-react-and-jsx-in-python-applications.md b/docs/_posts/2013-08-19-use-react-and-jsx-in-python-applications.md index 8dd9ac6f6b9..825ecaf4046 100644 --- a/docs/_posts/2013-08-19-use-react-and-jsx-in-python-applications.md +++ b/docs/_posts/2013-08-19-use-react-and-jsx-in-python-applications.md @@ -1,6 +1,5 @@ --- title: "Use React and JSX in Python Applications" -layout: post author: Kunal Mehta --- diff --git a/docs/_posts/2013-08-26-community-roundup-7.md b/docs/_posts/2013-08-26-community-roundup-7.md index b75b02c25f9..86d2ca26a9a 100644 --- a/docs/_posts/2013-08-26-community-roundup-7.md +++ b/docs/_posts/2013-08-26-community-roundup-7.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #7" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-09-24-community-roundup-8.md b/docs/_posts/2013-09-24-community-roundup-8.md index eb7c52f725d..b0df78b3202 100644 --- a/docs/_posts/2013-09-24-community-roundup-8.md +++ b/docs/_posts/2013-09-24-community-roundup-8.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #8" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-10-16-react-v0.5.0.md b/docs/_posts/2013-10-16-react-v0.5.0.md index aab495f118b..cf327b02df0 100644 --- a/docs/_posts/2013-10-16-react-v0.5.0.md +++ b/docs/_posts/2013-10-16-react-v0.5.0.md @@ -1,6 +1,5 @@ --- title: "React v0.5" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-10-29-react-v0-5-1.md b/docs/_posts/2013-10-29-react-v0-5-1.md index dcc8a2e3d88..672870b8e0e 100644 --- a/docs/_posts/2013-10-29-react-v0-5-1.md +++ b/docs/_posts/2013-10-29-react-v0-5-1.md @@ -1,6 +1,5 @@ --- title: "React v0.5.1" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-10-3-community-roundup-9.md b/docs/_posts/2013-10-3-community-roundup-9.md index 46accfa62c5..888d984a86e 100644 --- a/docs/_posts/2013-10-3-community-roundup-9.md +++ b/docs/_posts/2013-10-3-community-roundup-9.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #9" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-11-05-thinking-in-react.md b/docs/_posts/2013-11-05-thinking-in-react.md index aa2fb4b4390..f00aaa30b2a 100644 --- a/docs/_posts/2013-11-05-thinking-in-react.md +++ b/docs/_posts/2013-11-05-thinking-in-react.md @@ -1,6 +1,5 @@ --- title: "Thinking in React" -layout: post author: Pete Hunt --- diff --git a/docs/_posts/2013-11-06-community-roundup-10.md b/docs/_posts/2013-11-06-community-roundup-10.md index fa83a4745cb..f423fa81708 100644 --- a/docs/_posts/2013-11-06-community-roundup-10.md +++ b/docs/_posts/2013-11-06-community-roundup-10.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #10" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-11-18-community-roundup-11.md b/docs/_posts/2013-11-18-community-roundup-11.md index b7779b3bd46..0256e32317f 100644 --- a/docs/_posts/2013-11-18-community-roundup-11.md +++ b/docs/_posts/2013-11-18-community-roundup-11.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #11" -layout: post author: Vjeux --- @@ -89,4 +88,4 @@ This round-up is the proof that React has taken off from its Facebook's root: it ## Random Tweet -
\ No newline at end of file +
diff --git a/docs/_posts/2013-12-18-react-v0.5.2-v0.4.2.md b/docs/_posts/2013-12-18-react-v0.5.2-v0.4.2.md index f59462f2399..3c0105dc504 100644 --- a/docs/_posts/2013-12-18-react-v0.5.2-v0.4.2.md +++ b/docs/_posts/2013-12-18-react-v0.5.2-v0.4.2.md @@ -1,6 +1,5 @@ --- title: "React v0.5.2, v0.4.2" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-12-19-react-v0.8.0.md b/docs/_posts/2013-12-19-react-v0.8.0.md index 7c32d1de391..c7a6fe6381e 100644 --- a/docs/_posts/2013-12-19-react-v0.8.0.md +++ b/docs/_posts/2013-12-19-react-v0.8.0.md @@ -1,6 +1,5 @@ --- title: "React v0.8" -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2013-12-23-community-roundup-12.md b/docs/_posts/2013-12-23-community-roundup-12.md index 4710cb94ac0..7def798cfca 100644 --- a/docs/_posts/2013-12-23-community-roundup-12.md +++ b/docs/_posts/2013-12-23-community-roundup-12.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #12" -layout: post author: Vjeux --- diff --git a/docs/_posts/2013-12-30-community-roundup-13.md b/docs/_posts/2013-12-30-community-roundup-13.md index 21197470312..d647edc1591 100644 --- a/docs/_posts/2013-12-30-community-roundup-13.md +++ b/docs/_posts/2013-12-30-community-roundup-13.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #13" -layout: post author: Vjeux --- diff --git a/docs/_posts/2014-01-02-react-chrome-developer-tools.md b/docs/_posts/2014-01-02-react-chrome-developer-tools.md index 69265f5ddea..b395fa6692c 100644 --- a/docs/_posts/2014-01-02-react-chrome-developer-tools.md +++ b/docs/_posts/2014-01-02-react-chrome-developer-tools.md @@ -1,6 +1,5 @@ --- title: "React Chrome Developer Tools" -layout: post author: Sebastian Markbåge --- diff --git a/docs/_posts/2014-01-06-community-roundup-14.md b/docs/_posts/2014-01-06-community-roundup-14.md index d440daeaf24..a42c645cefb 100644 --- a/docs/_posts/2014-01-06-community-roundup-14.md +++ b/docs/_posts/2014-01-06-community-roundup-14.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #14" -layout: post author: Vjeux --- diff --git a/docs/_posts/2014-02-05-community-roundup-15.md b/docs/_posts/2014-02-05-community-roundup-15.md index 8e0d4a1605f..30bc07a829f 100644 --- a/docs/_posts/2014-02-05-community-roundup-15.md +++ b/docs/_posts/2014-02-05-community-roundup-15.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #15" -layout: post author: Jonas Gebhardt --- diff --git a/docs/_posts/2014-02-15-community-roundup-16.md b/docs/_posts/2014-02-15-community-roundup-16.md index 02ec66cc41b..8486e8e8479 100644 --- a/docs/_posts/2014-02-15-community-roundup-16.md +++ b/docs/_posts/2014-02-15-community-roundup-16.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #16" -layout: post author: Jonas Gebhardt --- diff --git a/docs/_posts/2014-02-16-react-v0.9-rc1.md b/docs/_posts/2014-02-16-react-v0.9-rc1.md index bee75e5fb2f..6e7588bca5c 100644 --- a/docs/_posts/2014-02-16-react-v0.9-rc1.md +++ b/docs/_posts/2014-02-16-react-v0.9-rc1.md @@ -1,6 +1,5 @@ --- title: React v0.9 RC -layout: post author: Ben Alpert --- diff --git a/docs/_posts/2014-02-20-react-v0.9.md b/docs/_posts/2014-02-20-react-v0.9.md index 95c6aa9e1d0..f44cab8d285 100644 --- a/docs/_posts/2014-02-20-react-v0.9.md +++ b/docs/_posts/2014-02-20-react-v0.9.md @@ -1,6 +1,5 @@ --- title: React v0.9 -layout: post author: Ben Alpert --- diff --git a/docs/_posts/2014-02-24-community-roundup-17.md b/docs/_posts/2014-02-24-community-roundup-17.md index ec2d98f8a3e..4d7aae92645 100644 --- a/docs/_posts/2014-02-24-community-roundup-17.md +++ b/docs/_posts/2014-02-24-community-roundup-17.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #17" -layout: post author: Jonas Gebhardt --- diff --git a/docs/_posts/2014-03-14-community-roundup-18.md b/docs/_posts/2014-03-14-community-roundup-18.md index 275c8fc307d..080537bf8fa 100644 --- a/docs/_posts/2014-03-14-community-roundup-18.md +++ b/docs/_posts/2014-03-14-community-roundup-18.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #18" -layout: post author: Jonas Gebhardt --- diff --git a/docs/_posts/2014-03-19-react-v0.10-rc1.md b/docs/_posts/2014-03-19-react-v0.10-rc1.md index 92cd75eb916..d55380d4cc5 100644 --- a/docs/_posts/2014-03-19-react-v0.10-rc1.md +++ b/docs/_posts/2014-03-19-react-v0.10-rc1.md @@ -1,6 +1,5 @@ --- title: React v0.10 RC -layout: post author: Paul O’Shannessy --- diff --git a/docs/_posts/2014-03-21-react-v0.10.md b/docs/_posts/2014-03-21-react-v0.10.md index 0bcda6277c8..fe816591c7e 100644 --- a/docs/_posts/2014-03-21-react-v0.10.md +++ b/docs/_posts/2014-03-21-react-v0.10.md @@ -1,6 +1,5 @@ --- title: React v0.10 -layout: post author: Paul O’Shannessy --- diff --git a/docs/_posts/2014-03-28-the-road-to-1.0.md b/docs/_posts/2014-03-28-the-road-to-1.0.md index bf21a7659b3..341506ad581 100644 --- a/docs/_posts/2014-03-28-the-road-to-1.0.md +++ b/docs/_posts/2014-03-28-the-road-to-1.0.md @@ -1,6 +1,5 @@ --- title: The Road to 1.0 -layout: post author: Paul O'Shannessy --- diff --git a/docs/_posts/2014-04-04-reactnet.md b/docs/_posts/2014-04-04-reactnet.md index 84f252c32dd..9aa4efe3a72 100644 --- a/docs/_posts/2014-04-04-reactnet.md +++ b/docs/_posts/2014-04-04-reactnet.md @@ -1,6 +1,5 @@ --- title: "Use React and JSX in ASP.NET MVC" -layout: post author: Daniel Lo Nigro --- diff --git a/docs/_posts/2014-05-06-flux.md b/docs/_posts/2014-05-06-flux.md index 688c5c45053..afa6a6f4b5b 100644 --- a/docs/_posts/2014-05-06-flux.md +++ b/docs/_posts/2014-05-06-flux.md @@ -1,6 +1,5 @@ --- title: "Flux: An Application Architecture for React" -layout: post author: Bill Fisher and Jing Chen --- diff --git a/docs/_posts/2014-05-29-one-year-of-open-source-react.md b/docs/_posts/2014-05-29-one-year-of-open-source-react.md index 3447da00eb5..7d44e1eb291 100644 --- a/docs/_posts/2014-05-29-one-year-of-open-source-react.md +++ b/docs/_posts/2014-05-29-one-year-of-open-source-react.md @@ -1,6 +1,5 @@ --- title: "One Year of Open-Source React" -layout: post author: Cheng Lou --- diff --git a/docs/_posts/2014-06-27-community-roundup-19.md b/docs/_posts/2014-06-27-community-roundup-19.md index 165a72cdf03..f50b7cc5f5b 100644 --- a/docs/_posts/2014-06-27-community-roundup-19.md +++ b/docs/_posts/2014-06-27-community-roundup-19.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #19" -layout: post author: Cheng Lou --- diff --git a/docs/_posts/2014-07-13-react-v0.11-rc1.md b/docs/_posts/2014-07-13-react-v0.11-rc1.md index 17417196a6f..cc1b4567c49 100644 --- a/docs/_posts/2014-07-13-react-v0.11-rc1.md +++ b/docs/_posts/2014-07-13-react-v0.11-rc1.md @@ -1,6 +1,5 @@ --- title: React v0.11 RC -layout: post author: Paul O’Shannessy --- diff --git a/docs/_posts/2014-07-17-react-v0.11.md b/docs/_posts/2014-07-17-react-v0.11.md index 10e305c727f..ced68742456 100644 --- a/docs/_posts/2014-07-17-react-v0.11.md +++ b/docs/_posts/2014-07-17-react-v0.11.md @@ -1,6 +1,5 @@ --- title: React v0.11 -layout: post author: Paul O’Shannessy --- diff --git a/docs/_posts/2014-07-25-react-v0.11.1.md b/docs/_posts/2014-07-25-react-v0.11.1.md index c241b3361ee..ce1c09935aa 100644 --- a/docs/_posts/2014-07-25-react-v0.11.1.md +++ b/docs/_posts/2014-07-25-react-v0.11.1.md @@ -1,6 +1,5 @@ --- title: React v0.11.1 -layout: post author: Paul O’Shannessy --- diff --git a/docs/_posts/2014-07-28-community-roundup-20.md b/docs/_posts/2014-07-28-community-roundup-20.md index 5c46bc16186..0b4cfdf9698 100644 --- a/docs/_posts/2014-07-28-community-roundup-20.md +++ b/docs/_posts/2014-07-28-community-roundup-20.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #20" -layout: post author: Lou Husson --- @@ -52,12 +51,12 @@ React.renderComponent( ## Thinking and Learning React -Josephine Hall, working at Icelab, used React to write a mobile-focused application. She wrote a blog post [“Thinking and Learning React.js”](http://icelab.com.au/articles/thinking-and-learning-reactjs/) to share her experience with elements they had to use. You'll learn about routing, event dispatch, touchable components, and basic animations. +Josephine Hall, working at Icelab, used React to write a mobile-focused application. She wrote a blog post [“Thinking and Learning React.js”](http://icelab.com.au/articles/thinking-and-learning-reactjs/) to share her experience with elements they had to use. You'll learn about routing, event dispatch, touchable components, and basic animations. ## London React Meetup -If you missed the last [London React Meetup](http://www.meetup.com/London-React-User-Group/events/191406572/), the video is available, with lots of great content. +If you missed the last [London React Meetup](http://www.meetup.com/London-React-User-Group/events/191406572/), the video is available, with lots of great content. - What's new in React 0.11 and how to improve performance by guaranteeing immutability - State handling in React with Morearty.JS @@ -101,7 +100,7 @@ var Foo = React.createClass({ this.setState({scriptLoading: false, scriptLoadError: true}); }, render: function() { - var message = + var message = this.state.scriptLoading ? 'Loading script...' : this.state.scriptLoadError ? 'Loading failed' : 'Loading succeeded'; diff --git a/docs/_posts/2014-07-30-flux-actions-and-the-dispatcher.md b/docs/_posts/2014-07-30-flux-actions-and-the-dispatcher.md index 7075b900dcc..5c6ec2fc58a 100644 --- a/docs/_posts/2014-07-30-flux-actions-and-the-dispatcher.md +++ b/docs/_posts/2014-07-30-flux-actions-and-the-dispatcher.md @@ -1,6 +1,5 @@ --- title: "Flux: Actions and the Dispatcher" -layout: post author: Bill Fisher --- @@ -30,7 +29,7 @@ Letting the stores update themselves eliminates many entanglements typically fou Why We Need a Dispatcher ------------------------ -As an application grows, dependencies across different stores are a near certainty. Store A will inevitably need Store B to update itself first, so that Store A can know how to update itself. We need the dispatcher to be able to invoke the callback for Store B, and finish that callback, before moving forward with Store A. To declaratively assert this dependency, a store needs to be able to say to the dispatcher, "I need to wait for Store B to finish processing this action." The dispatcher provides this functionality through its waitFor() method. +As an application grows, dependencies across different stores are a near certainty. Store A will inevitably need Store B to update itself first, so that Store A can know how to update itself. We need the dispatcher to be able to invoke the callback for Store B, and finish that callback, before moving forward with Store A. To declaratively assert this dependency, a store needs to be able to say to the dispatcher, "I need to wait for Store B to finish processing this action." The dispatcher provides this functionality through its waitFor() method. The dispatch() method provides a simple, synchronous iteration through the callbacks, invoking each in turn. When waitFor() is encountered within one of the callbacks, execution of that callback stops and waitFor() provides us with a new iteration cycle over the dependencies. After the entire set of dependencies have been fulfilled, the original callback then continues to execute. diff --git a/docs/_posts/2014-08-03-community-roundup-21.md b/docs/_posts/2014-08-03-community-roundup-21.md index 9b1afe0c9a5..3c4bb3c2135 100644 --- a/docs/_posts/2014-08-03-community-roundup-21.md +++ b/docs/_posts/2014-08-03-community-roundup-21.md @@ -1,6 +1,5 @@ --- title: "Community Round-up #21" -layout: post author: Lou Husson --- From 4c7cd13ab3e7507e9ee97af0f902b20ca1126ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 11:40:14 -0700 Subject: [PATCH 5/8] Set default layout for docs --- docs/_config.yml | 5 +++++ docs/docs/01-why-react.md | 1 - docs/docs/01-why-react.zh-CN.md | 1 - docs/docs/02-displaying-data.md | 1 - docs/docs/02.1-jsx-in-depth.md | 1 - docs/docs/02.2-jsx-gotchas.md | 1 - docs/docs/03-interactivity-and-dynamic-uis.md | 1 - docs/docs/04-multiple-components.md | 1 - docs/docs/05-reusable-components.md | 1 - docs/docs/06-forms.md | 1 - docs/docs/07-working-with-the-browser.md | 1 - docs/docs/07.1-more-about-refs.md | 1 - docs/docs/08-tooling-integration.md | 1 - docs/docs/09-addons.md | 1 - docs/docs/09.1-animation.md | 1 - docs/docs/09.2-form-input-binding-sugar.md | 1 - docs/docs/09.3-class-name-manipulation.md | 1 - docs/docs/09.4-test-utils.md | 1 - docs/docs/09.5-clone-with-props.md | 1 - docs/docs/09.6-update.md | 1 - docs/docs/09.7-pure-render-mixin.md | 1 - docs/docs/09.8-perf.md | 1 - docs/docs/complementary-tools.md | 1 - docs/docs/examples.md | 1 - docs/docs/flux-overview.md | 1 - docs/docs/flux-todo-list.md | 1 - docs/docs/getting-started.md | 1 - docs/docs/getting-started.zh-CN.md | 1 - docs/docs/ref-01-top-level-api.md | 1 - docs/docs/ref-02-component-api.md | 1 - docs/docs/ref-03-component-specs.md | 1 - docs/docs/ref-04-tags-and-attributes.md | 1 - docs/docs/ref-05-events.md | 1 - docs/docs/ref-06-dom-differences.md | 1 - docs/docs/ref-07-special-non-dom-attributes.md | 1 - docs/docs/ref-08-reconciliation.md | 1 - docs/docs/thinking-in-react.md | 1 - docs/docs/tutorial.md | 1 - docs/docs/videos.md | 1 - 39 files changed, 5 insertions(+), 38 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index 56cc1b31108..e05686801fc 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -15,6 +15,11 @@ defaults: type: post values: layout: post +- scope: + path: docs + type: page + values: + layout: docs exclude: - Gemfile - Gemfile.lock diff --git a/docs/docs/01-why-react.md b/docs/docs/01-why-react.md index 0968b729064..a11b49bd399 100644 --- a/docs/docs/01-why-react.md +++ b/docs/docs/01-why-react.md @@ -1,7 +1,6 @@ --- id: why-react title: Why React? -layout: docs permalink: why-react.html next: displaying-data.html --- diff --git a/docs/docs/01-why-react.zh-CN.md b/docs/docs/01-why-react.zh-CN.md index 44e92ef7161..86e033f2bcc 100644 --- a/docs/docs/01-why-react.zh-CN.md +++ b/docs/docs/01-why-react.zh-CN.md @@ -1,7 +1,6 @@ --- id: why-react-zh-CN title: 为什么使用 React? -layout: docs permalink: why-react-zh-CN.html next: displaying-data.html --- diff --git a/docs/docs/02-displaying-data.md b/docs/docs/02-displaying-data.md index 6e9966711bf..d101a6d9081 100644 --- a/docs/docs/02-displaying-data.md +++ b/docs/docs/02-displaying-data.md @@ -1,7 +1,6 @@ --- id: displaying-data title: Displaying Data -layout: docs permalink: displaying-data.html prev: why-react.html next: jsx-in-depth.html diff --git a/docs/docs/02.1-jsx-in-depth.md b/docs/docs/02.1-jsx-in-depth.md index 595c0c5fec7..14924f746c6 100644 --- a/docs/docs/02.1-jsx-in-depth.md +++ b/docs/docs/02.1-jsx-in-depth.md @@ -1,7 +1,6 @@ --- id: jsx-in-depth title: JSX in Depth -layout: docs permalink: jsx-in-depth.html prev: displaying-data.html next: jsx-gotchas.html diff --git a/docs/docs/02.2-jsx-gotchas.md b/docs/docs/02.2-jsx-gotchas.md index 21074dd2f22..57280079db3 100644 --- a/docs/docs/02.2-jsx-gotchas.md +++ b/docs/docs/02.2-jsx-gotchas.md @@ -1,7 +1,6 @@ --- id: jsx-gotchas title: JSX Gotchas -layout: docs permalink: jsx-gotchas.html prev: jsx-in-depth.html next: interactivity-and-dynamic-uis.html diff --git a/docs/docs/03-interactivity-and-dynamic-uis.md b/docs/docs/03-interactivity-and-dynamic-uis.md index 754a32943bf..d178e4420b4 100644 --- a/docs/docs/03-interactivity-and-dynamic-uis.md +++ b/docs/docs/03-interactivity-and-dynamic-uis.md @@ -1,7 +1,6 @@ --- id: interactivity-and-dynamic-uis title: Interactivity and Dynamic UIs -layout: docs permalink: interactivity-and-dynamic-uis.html prev: jsx-gotchas.html next: multiple-components.html diff --git a/docs/docs/04-multiple-components.md b/docs/docs/04-multiple-components.md index 85cefffff63..eb04cfd3f44 100644 --- a/docs/docs/04-multiple-components.md +++ b/docs/docs/04-multiple-components.md @@ -1,7 +1,6 @@ --- id: multiple-components title: Multiple Components -layout: docs permalink: multiple-components.html prev: interactivity-and-dynamic-uis.html next: reusable-components.html diff --git a/docs/docs/05-reusable-components.md b/docs/docs/05-reusable-components.md index dae061f4255..8de963e4ba1 100644 --- a/docs/docs/05-reusable-components.md +++ b/docs/docs/05-reusable-components.md @@ -1,7 +1,6 @@ --- id: reusable-components title: Reusable Components -layout: docs permalink: reusable-components.html prev: multiple-components.html next: forms.html diff --git a/docs/docs/06-forms.md b/docs/docs/06-forms.md index 8cea0db813e..002d68192be 100644 --- a/docs/docs/06-forms.md +++ b/docs/docs/06-forms.md @@ -1,7 +1,6 @@ --- id: forms title: Forms -layout: docs permalink: forms.html prev: reusable-components.html next: working-with-the-browser.html diff --git a/docs/docs/07-working-with-the-browser.md b/docs/docs/07-working-with-the-browser.md index 565d824280b..e3780fe6fa9 100644 --- a/docs/docs/07-working-with-the-browser.md +++ b/docs/docs/07-working-with-the-browser.md @@ -1,7 +1,6 @@ --- id: working-with-the-browser title: Working With the Browser -layout: docs permalink: working-with-the-browser.html prev: forms.html next: more-about-refs.html diff --git a/docs/docs/07.1-more-about-refs.md b/docs/docs/07.1-more-about-refs.md index fa92805def2..fc6c95960d9 100644 --- a/docs/docs/07.1-more-about-refs.md +++ b/docs/docs/07.1-more-about-refs.md @@ -1,7 +1,6 @@ --- id: more-about-refs title: More About Refs -layout: docs permalink: more-about-refs.html prev: working-with-the-browser.html next: tooling-integration.html diff --git a/docs/docs/08-tooling-integration.md b/docs/docs/08-tooling-integration.md index 93416d301cc..8973df58126 100644 --- a/docs/docs/08-tooling-integration.md +++ b/docs/docs/08-tooling-integration.md @@ -1,7 +1,6 @@ --- id: tooling-integration title: Tooling Integration -layout: docs permalink: tooling-integration.html prev: more-about-refs.html next: addons.html diff --git a/docs/docs/09-addons.md b/docs/docs/09-addons.md index 33aca262a5f..1bd3f6f4a42 100644 --- a/docs/docs/09-addons.md +++ b/docs/docs/09-addons.md @@ -1,7 +1,6 @@ --- id: addons title: Add-ons -layout: docs permalink: addons.html prev: tooling-integration.html next: animation.html diff --git a/docs/docs/09.1-animation.md b/docs/docs/09.1-animation.md index f310a13f508..17b2e099de2 100644 --- a/docs/docs/09.1-animation.md +++ b/docs/docs/09.1-animation.md @@ -1,7 +1,6 @@ --- id: animation title: Animation -layout: docs permalink: animation.html prev: addons.html next: two-way-binding-helpers.html diff --git a/docs/docs/09.2-form-input-binding-sugar.md b/docs/docs/09.2-form-input-binding-sugar.md index 29317f71dca..d3016ad74ce 100644 --- a/docs/docs/09.2-form-input-binding-sugar.md +++ b/docs/docs/09.2-form-input-binding-sugar.md @@ -1,7 +1,6 @@ --- id: two-way-binding-helpers title: Two-Way Binding Helpers -layout: docs permalink: two-way-binding-helpers.html prev: animation.html next: class-name-manipulation.html diff --git a/docs/docs/09.3-class-name-manipulation.md b/docs/docs/09.3-class-name-manipulation.md index ca2e1fdee00..e898646398c 100644 --- a/docs/docs/09.3-class-name-manipulation.md +++ b/docs/docs/09.3-class-name-manipulation.md @@ -1,7 +1,6 @@ --- id: class-name-manipulation title: Class Name Manipulation -layout: docs permalink: class-name-manipulation.html prev: two-way-binding-helpers.html next: test-utils.html diff --git a/docs/docs/09.4-test-utils.md b/docs/docs/09.4-test-utils.md index ef40cf65d52..0b05d8fcbb9 100644 --- a/docs/docs/09.4-test-utils.md +++ b/docs/docs/09.4-test-utils.md @@ -1,7 +1,6 @@ --- id: test-utils title: Test Utilities -layout: docs permalink: test-utils.html prev: class-name-manipulation.html next: clone-with-props.html diff --git a/docs/docs/09.5-clone-with-props.md b/docs/docs/09.5-clone-with-props.md index 0d466adf4a2..88f9e7b4a70 100644 --- a/docs/docs/09.5-clone-with-props.md +++ b/docs/docs/09.5-clone-with-props.md @@ -1,7 +1,6 @@ --- id: clone-with-props title: Cloning Components -layout: docs permalink: clone-with-props.html prev: test-utils.html next: update.html diff --git a/docs/docs/09.6-update.md b/docs/docs/09.6-update.md index 5348f963140..2169ba5c1c6 100644 --- a/docs/docs/09.6-update.md +++ b/docs/docs/09.6-update.md @@ -1,7 +1,6 @@ --- id: update title: Immutability Helpers -layout: docs permalink: update.html prev: clone-with-props.html next: pure-render-mixin.html diff --git a/docs/docs/09.7-pure-render-mixin.md b/docs/docs/09.7-pure-render-mixin.md index 5f2f5f8852f..06620fa6788 100644 --- a/docs/docs/09.7-pure-render-mixin.md +++ b/docs/docs/09.7-pure-render-mixin.md @@ -1,7 +1,6 @@ --- id: pure-render-mixin title: PureRenderMixin -layout: docs permalink: pure-render-mixin.html prev: update.html next: perf.html diff --git a/docs/docs/09.8-perf.md b/docs/docs/09.8-perf.md index 74bc71634a7..0a460b2d933 100644 --- a/docs/docs/09.8-perf.md +++ b/docs/docs/09.8-perf.md @@ -1,7 +1,6 @@ --- id: perf title: Performance Tools -layout: docs permalink: perf.html prev: pure-render-mixin.html --- diff --git a/docs/docs/complementary-tools.md b/docs/docs/complementary-tools.md index 6bd66d055ea..0d4190c1b86 100644 --- a/docs/docs/complementary-tools.md +++ b/docs/docs/complementary-tools.md @@ -1,7 +1,6 @@ --- id: complementary-tools title: Complementary Tools -layout: docs permalink: complementary-tools.html prev: videos.html next: examples.html diff --git a/docs/docs/examples.md b/docs/docs/examples.md index 82e8d39c99a..f539f4f60a2 100644 --- a/docs/docs/examples.md +++ b/docs/docs/examples.md @@ -1,7 +1,6 @@ --- id: examples title: Examples -layout: docs permalink: examples.html prev: complementary-tools.html --- diff --git a/docs/docs/flux-overview.md b/docs/docs/flux-overview.md index c93feee34e2..9b6482e3a75 100644 --- a/docs/docs/flux-overview.md +++ b/docs/docs/flux-overview.md @@ -1,7 +1,6 @@ --- id: flux-overview title: Flux Application Architecture -layout: docs next: flux-todo-list.html --- diff --git a/docs/docs/flux-todo-list.md b/docs/docs/flux-todo-list.md index 6df4e2fd1b6..f79bf7e7602 100644 --- a/docs/docs/flux-todo-list.md +++ b/docs/docs/flux-todo-list.md @@ -1,7 +1,6 @@ --- id: flux-todo-list title: Flux TodoMVC Tutorial -layout: docs prev: flux-overview.html --- diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 956fb4cf800..57a20024316 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -1,7 +1,6 @@ --- id: getting-started title: Getting Started -layout: docs next: tutorial.html --- diff --git a/docs/docs/getting-started.zh-CN.md b/docs/docs/getting-started.zh-CN.md index 2622874a420..a785cd31564 100644 --- a/docs/docs/getting-started.zh-CN.md +++ b/docs/docs/getting-started.zh-CN.md @@ -1,7 +1,6 @@ --- id: getting-started-zh-CN title: 入门教程 -layout: docs next: tutorial.html --- diff --git a/docs/docs/ref-01-top-level-api.md b/docs/docs/ref-01-top-level-api.md index 9a215b76ecb..c31e9acbedd 100644 --- a/docs/docs/ref-01-top-level-api.md +++ b/docs/docs/ref-01-top-level-api.md @@ -1,7 +1,6 @@ --- id: top-level-api title: Top-Level API -layout: docs permalink: top-level-api.html next: component-api.html --- diff --git a/docs/docs/ref-02-component-api.md b/docs/docs/ref-02-component-api.md index f2b5732d1c8..41cb101b246 100644 --- a/docs/docs/ref-02-component-api.md +++ b/docs/docs/ref-02-component-api.md @@ -1,7 +1,6 @@ --- id: component-api title: Component API -layout: docs permalink: component-api.html prev: top-level-api.html next: component-specs.html diff --git a/docs/docs/ref-03-component-specs.md b/docs/docs/ref-03-component-specs.md index 4d68915f31d..a21fb68a29a 100644 --- a/docs/docs/ref-03-component-specs.md +++ b/docs/docs/ref-03-component-specs.md @@ -1,7 +1,6 @@ --- id: component-specs title: Component Specs and Lifecycle -layout: docs permalink: component-specs.html prev: component-api.html next: tags-and-attributes.html diff --git a/docs/docs/ref-04-tags-and-attributes.md b/docs/docs/ref-04-tags-and-attributes.md index 905c1a954de..f43b05cc3c4 100644 --- a/docs/docs/ref-04-tags-and-attributes.md +++ b/docs/docs/ref-04-tags-and-attributes.md @@ -1,7 +1,6 @@ --- id: tags-and-attributes title: Tags and Attributes -layout: docs permalink: tags-and-attributes.html prev: component-specs.html next: events.html diff --git a/docs/docs/ref-05-events.md b/docs/docs/ref-05-events.md index 84a7abfb594..f331d01080d 100644 --- a/docs/docs/ref-05-events.md +++ b/docs/docs/ref-05-events.md @@ -1,7 +1,6 @@ --- id: events title: Event System -layout: docs permalink: events.html prev: tags-and-attributes.html next: dom-differences.html diff --git a/docs/docs/ref-06-dom-differences.md b/docs/docs/ref-06-dom-differences.md index dcae0f872eb..ceeeac9bbfe 100644 --- a/docs/docs/ref-06-dom-differences.md +++ b/docs/docs/ref-06-dom-differences.md @@ -1,7 +1,6 @@ --- id: dom-differences title: DOM Differences -layout: docs permalink: dom-differences.html prev: events.html next: special-non-dom-attributes.html diff --git a/docs/docs/ref-07-special-non-dom-attributes.md b/docs/docs/ref-07-special-non-dom-attributes.md index ae0b5e7c6a0..38e3ce8ea43 100644 --- a/docs/docs/ref-07-special-non-dom-attributes.md +++ b/docs/docs/ref-07-special-non-dom-attributes.md @@ -1,7 +1,6 @@ --- id: special-non-dom-attributes title: Special Non-DOM Attributes -layout: docs permalink: special-non-dom-attributes.html prev: dom-differences.html next: reconciliation.html diff --git a/docs/docs/ref-08-reconciliation.md b/docs/docs/ref-08-reconciliation.md index 56c94368784..7332103dfba 100644 --- a/docs/docs/ref-08-reconciliation.md +++ b/docs/docs/ref-08-reconciliation.md @@ -1,7 +1,6 @@ --- id: reconciliation title: Reconciliation -layout: docs permalink: reconciliation.html prev: special-non-dom-attributes.html --- diff --git a/docs/docs/thinking-in-react.md b/docs/docs/thinking-in-react.md index c8f1ac16568..67aa06b0690 100644 --- a/docs/docs/thinking-in-react.md +++ b/docs/docs/thinking-in-react.md @@ -1,7 +1,6 @@ --- id: thinking-in-react title: Thinking in React -layout: docs prev: tutorial.html next: videos.html --- diff --git a/docs/docs/tutorial.md b/docs/docs/tutorial.md index fb826c1f0ba..6b771aebab2 100644 --- a/docs/docs/tutorial.md +++ b/docs/docs/tutorial.md @@ -1,7 +1,6 @@ --- id: tutorial title: Tutorial -layout: docs prev: getting-started.html next: thinking-in-react.html --- diff --git a/docs/docs/videos.md b/docs/docs/videos.md index d9b8a3abf43..488b8030c0c 100644 --- a/docs/docs/videos.md +++ b/docs/docs/videos.md @@ -1,7 +1,6 @@ --- id: videos title: Videos -layout: docs permalink: videos.html prev: thinking-in-react.html next: complementary-tools.html From 51df0efe343fc4d662abe91bd280cc42149ab426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 11:48:09 -0700 Subject: [PATCH 6/8] Use jekyll-redirect-from instead of our other redirect method --- docs/Gemfile | 3 +++ docs/Gemfile.lock | 3 +++ docs/_config.yml | 2 ++ docs/_layouts/redirect.html | 6 ------ docs/docs/getting-started.md | 1 + docs/docs/index.html | 4 ---- docs/docs/ref-01-top-level-api.md | 1 + docs/docs/reference.html | 4 ---- 8 files changed, 10 insertions(+), 14 deletions(-) delete mode 100644 docs/_layouts/redirect.html delete mode 100644 docs/docs/index.html delete mode 100644 docs/docs/reference.html diff --git a/docs/Gemfile b/docs/Gemfile index 56b9cdeeb5e..4f4991e3b2a 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -6,6 +6,9 @@ gem 'rake' # 2.0 includes sass processing gem 'jekyll', '~>2.0' +# Auto redirect pages +gem 'jekyll-redirect-from' + # JSON gem 'json' diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index cd585ba5aa8..a520567cf1f 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -33,6 +33,8 @@ GEM coffee-script (~> 2.2) jekyll-gist (1.1.0) jekyll-paginate (1.0.0) + jekyll-redirect-from (0.5.0) + jekyll (~> 2.0) jekyll-sass-converter (1.2.0) sass (~> 3.2) jekyll-watch (1.1.0) @@ -73,6 +75,7 @@ PLATFORMS DEPENDENCIES jekyll (~> 2.0) + jekyll-redirect-from json rake rb-fsevent diff --git a/docs/_config.yml b/docs/_config.yml index e05686801fc..75ca27e2332 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -32,4 +32,6 @@ redcarpet: sass: style: :compressed sass_dir: _css +gems: +- jekyll-redirect-from react_version: 0.11.1 diff --git a/docs/_layouts/redirect.html b/docs/_layouts/redirect.html deleted file mode 100644 index c24f8174849..00000000000 --- a/docs/_layouts/redirect.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/docs/docs/getting-started.md b/docs/docs/getting-started.md index 57a20024316..36c3a59be0d 100644 --- a/docs/docs/getting-started.md +++ b/docs/docs/getting-started.md @@ -2,6 +2,7 @@ id: getting-started title: Getting Started next: tutorial.html +redirect_from: "docs/index.html" --- ## JSFiddle diff --git a/docs/docs/index.html b/docs/docs/index.html deleted file mode 100644 index 4ea0787d5ec..00000000000 --- a/docs/docs/index.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: redirect -destination: getting-started.html ---- diff --git a/docs/docs/ref-01-top-level-api.md b/docs/docs/ref-01-top-level-api.md index c31e9acbedd..5e93c651646 100644 --- a/docs/docs/ref-01-top-level-api.md +++ b/docs/docs/ref-01-top-level-api.md @@ -3,6 +3,7 @@ id: top-level-api title: Top-Level API permalink: top-level-api.html next: component-api.html +redirect_from: "/docs/reference.html" --- ## React diff --git a/docs/docs/reference.html b/docs/docs/reference.html deleted file mode 100644 index 0d21cd16f4e..00000000000 --- a/docs/docs/reference.html +++ /dev/null @@ -1,4 +0,0 @@ ---- -layout: redirect -destination: top-level-api.html ---- From 2cbf609856ceed4d3a0c34c6782e1d596caf69ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 12:24:44 -0700 Subject: [PATCH 7/8] Autogenerate acknowledgements --- docs/Rakefile | 10 ++ docs/_data/acknowledgements.yml | 179 ++++++++++++++++++++++++++++++ docs/acknowledgements.md | 187 +------------------------------- 3 files changed, 194 insertions(+), 182 deletions(-) create mode 100644 docs/_data/acknowledgements.yml diff --git a/docs/Rakefile b/docs/Rakefile index 9fd343cd706..44a3e114758 100644 --- a/docs/Rakefile +++ b/docs/Rakefile @@ -23,6 +23,16 @@ task :update_version do end end +desc "update acknowledgements list" +task :update_acknowledgements do + authors = File.readlines('../AUTHORS').map {|author| author.gsub(/ <.*\n/,'')} + # split into cols here because nobody knows how to use liquid + # need to to_f because ruby will keep slice_size as int and round on its own + slice_size = (authors.size / 3.to_f).ceil + cols = authors.each_slice(slice_size).to_a + File.open('_data/acknowledgements.yml', 'w+') { |f| f.write(cols.to_yaml) } +end + desc "build into ../../react-gh-pages" task :release => [:update_version, :default] do system "jekyll build -d ../../react-gh-pages" diff --git a/docs/_data/acknowledgements.yml b/docs/_data/acknowledgements.yml new file mode 100644 index 00000000000..89f112ef2bf --- /dev/null +++ b/docs/_data/acknowledgements.yml @@ -0,0 +1,179 @@ +--- +- - Adam Krebs + - Adam Solove + - Alan deLevie + - Alex Zelenskiy + - Alexander Solovyov + - Andreas Svensson + - Andrew Davey + - Andrew Zich + - Andrey Popp + - Anthony van der Hoorn + - Ayman Osman + - Ben Alpert + - Ben Newman + - Ben Ripkens + - Bill Fisher + - Bob Eagan + - Bojan Mihelac + - Brandon Bloom + - Brian Cooke + - Brian Kim + - Brian Reavis + - Brian Rue + - Cam Spiers + - Cassus Adam Banko + - Cat Chen + - Cheng Lou + - Christian Roman + - Christoph Pojer + - Christopher Monsanto + - Clay Allsopp + - Connor McSheffrey + - Dan Schafer + - Daniel Gasienica + - Daniel Lo Nigro + - Daniel Miladinov + - Daniel Schonfeld + - Danny Ben-David + - Daryl Lau + - David Hellsing + - David Hu + - Devon Blandin + - Dmitry Mazuro + - Dustin Getz + - Enguerran + - Eric Clemmons + - Eric Florenzano + - Eric Schoffstall + - Evan Coonrod + - Fabio M. Costa + - Felipe Oliveira Carvalho + - Felix Kling + - Fernando Correia + - François-Xavier Bois + - Fred Zhao + - G Scott Olson + - Geert Pasteels + - Geert-Jan Brits + - George A Sisco III + - Gilbert + - Greg Hurrell +- - Greg Roodt + - Guangqiang Dong + - Guido Bouman + - Harry Hull + - Harshad Sabne + - Hendrik Swanepoel + - Hugo Jobling + - Ian Obermiller + - Ingvar Stepanyan + - Irae Carvalho + - Isaac Salier-Hellendag + - Ivan Kozik + - Jaime Mingo + - Jakub Malinowski + - James Brantly + - James Ide + - Jamie Wong + - Jamison Dance + - Jan Kassens + - Jared Forsyth + - Jason Bonta + - Jason Trill + - Jean Lauliac + - Jeff Barczewski + - Jeff Carpenter + - Jeff Morrison + - Jeff Welch + - Jeffrey Lin + - Jignesh Kakadiya + - Jing Chen + - Johannes Baiter + - John Watson + - Jon Beebe + - Jonas Enlund + - Jonas Gebhardt + - Jonathan Hsu + - Jordan Walke + - Josh Bassett + - Josh Duck + - Josh Yudaken + - Joshua Ma + - Julen Ruiz Aizpuru + - Jun Wu + - Juraj Dudak + - Justin Jaffray + - Karl Mikkelsen + - Keito Uchiyama + - Kit Randel + - Kunal Mehta + - Kyle Mathews + - Laurence Rowe + - Levi McCallum + - Lily + - Logan Allen + - Luigy Leon + - Marcin Kwiatkowski + - Marcin Szczepanski + - Mariano Desanze + - Mark Richardson + - Marshall Roch +- - Martin Andert + - Martin Konicek + - Mathieu M-Gosselin + - Matt Harrison + - Matthew Dapena-Tretter + - Matti Nelimarkka + - Michal Srb + - Mouad Debbar + - Nadeesha Cabral + - Nate Hunzaker + - Nicholas Bergson-Shilcock + - Nick Gavalas + - Nick Thompson + - Niklas Boström + - Owen Coutts + - Pascal Hartig + - Paul O’Shannessy + - Paul Seiffert + - Paul Shen + - Pete Hunt + - Peter Cottle + - Petri Lievonen + - Pieter Vanderwerff + - Rajiv Tirumalareddy + - Randall Randall + - Ray + - Richard D. Worth + - Richard Feldman + - Richard Livesey + - Ryan Seddon + - Sahat Yalkabov + - Sander Spies + - Sean Kinsey + - Sebastian Markbåge + - Shaun Trennery + - Simon Højberg + - Stefan Dombrowski + - Stephen Murphy + - Stoyan Stefanov + - Sundeep Malladi + - Sven Helmberger + - Thomas Aylott + - Thomas Boyt + - Thomas Shaddox + - Thomas Shafer + - Timothy Yung + - Tom Haggie + - Tom Occhino + - Ville Immonen + - Vjeux + - Volkan Unsal + - Wayne Larsen + - Wincent Colaiuta + - Yuriy Dybskiy + - Yuval Dekel + - Zach Bruggeman + - davidxi + - imagentleman diff --git a/docs/acknowledgements.md b/docs/acknowledgements.md index 298b4e57df5..cf549515602 100644 --- a/docs/acknowledgements.md +++ b/docs/acknowledgements.md @@ -7,190 +7,13 @@ layout: single We'd like to thank all of our contributors:
+ {% for author_col in site.data.acknowledgements %}
    -
  • Adam Krebs
  • -
  • Adam Solove
  • -
  • Alan deLevie
  • -
  • Alex Zelenskiy
  • -
  • Alexander Solovyov
  • -
  • Andreas Svensson
  • -
  • Andrew Davey
  • -
  • Andrew Zich
  • -
  • Andrey Popp
  • -
  • Anthony van der Hoorn
  • -
  • Ayman Osman
  • -
  • Ben Alpert
  • -
  • Ben Newman
  • -
  • Ben Ripkens
  • -
  • Bill Fisher
  • -
  • Bob Eagan
  • -
  • Bojan Mihelac
  • -
  • Brandon Bloom
  • -
  • Brian Cooke
  • -
  • Brian Kim
  • -
  • Brian Reavis
  • -
  • Brian Rue
  • -
  • Cam Spiers
  • -
  • Cassus Adam Banko
  • -
  • Cat Chen
  • -
  • Cheng Lou
  • -
  • Christian Roman
  • -
  • Christoph Pojer
  • -
  • Christopher Monsanto
  • -
  • Clay Allsopp
  • -
  • Connor McSheffrey
  • -
  • Dan Schafer
  • -
  • Daniel Gasienica
  • -
  • Daniel Lo Nigro
  • -
  • Daniel Miladinov
  • -
  • Daniel Schonfeld
  • -
  • Danny Ben-David
  • -
  • Daryl Lau
  • -
  • David Hellsing
  • -
  • David Hu
  • -
  • Devon Blandin
  • -
  • Dmitry Mazuro
  • -
  • Dustin Getz
  • -
  • Enguerran
  • -
  • Eric Clemmons
  • -
  • Eric Florenzano
  • -
  • Eric Schoffstall
  • -
  • Evan Coonrod
  • -
  • Fabio M. Costa
  • -
  • Felipe Oliveira Carvalho
  • -
  • Felix Kling
  • -
  • Fernando Correia
  • -
  • François-Xavier Bois
  • -
  • Fred Zhao
  • -
  • G Scott Olson
  • -
  • Geert Pasteels
  • -
  • Geert-Jan Brits
  • -
  • George A Sisco III
  • -
  • Gilbert
  • -
  • Greg Hurrell
  • -
-
    -
  • Greg Roodt
  • -
  • Guangqiang Dong
  • -
  • Guido Bouman
  • -
  • Harry Hull
  • -
  • Harshad Sabne
  • -
  • Hendrik Swanepoel
  • -
  • Hugo Jobling
  • -
  • Ian Obermiller
  • -
  • Ingvar Stepanyan
  • -
  • Irae Carvalho
  • -
  • Isaac Salier-Hellendag
  • -
  • Ivan Kozik
  • -
  • Jaime Mingo
  • -
  • Jakub Malinowski
  • -
  • James Brantly
  • -
  • James Ide
  • -
  • Jamie Wong
  • -
  • Jamison Dance
  • -
  • Jan Kassens
  • -
  • Jared Forsyth
  • -
  • Jason Bonta
  • -
  • Jason Trill
  • -
  • Jean Lauliac
  • -
  • Jeff Barczewski
  • -
  • Jeff Carpenter
  • -
  • Jeff Morrison
  • -
  • Jeff Welch
  • -
  • Jeffrey Lin
  • -
  • Jignesh Kakadiya
  • -
  • Jing Chen
  • -
  • Johannes Baiter
  • -
  • John Watson
  • -
  • Jon Beebe
  • -
  • Jonas Enlund
  • -
  • Jonas Gebhardt
  • -
  • Jonathan Hsu
  • -
  • Jordan Walke
  • -
  • Josh Bassett
  • -
  • Josh Duck
  • -
  • Josh Yudaken
  • -
  • Joshua Ma
  • -
  • Julen Ruiz Aizpuru
  • -
  • Jun Wu
  • -
  • Juraj Dudak
  • -
  • Justin Jaffray
  • -
  • Karl Mikkelsen
  • -
  • Keito Uchiyama
  • -
  • Kit Randel
  • -
  • Kunal Mehta
  • -
  • Kyle Mathews
  • -
  • Laurence Rowe
  • -
  • Levi McCallum
  • -
  • Lily
  • -
  • Logan Allen
  • -
  • Luigy Leon
  • -
  • Marcin Kwiatkowski
  • -
  • Marcin Szczepanski
  • -
  • Mariano Desanze
  • -
  • Mark Richardson
  • -
-
    -
  • Marshall Roch
  • -
  • Martin Andert
  • -
  • Martin Konicek
  • -
  • Mathieu M-Gosselin
  • -
  • Matt Harrison
  • -
  • Matthew Dapena-Tretter
  • -
  • Matti Nelimarkka
  • -
  • Michal Srb
  • -
  • Mouad Debbar
  • -
  • Nadeesha Cabral
  • -
  • Nate Hunzaker
  • -
  • Nicholas Bergson-Shilcock
  • -
  • Nick Gavalas
  • -
  • Nick Thompson
  • -
  • Niklas Boström
  • -
  • Owen Coutts
  • -
  • Pascal Hartig
  • -
  • Paul O’Shannessy
  • -
  • Paul Seiffert
  • -
  • Paul Shen
  • -
  • Pete Hunt
  • -
  • Peter Cottle
  • -
  • Petri Lievonen
  • -
  • Pieter Vanderwerff
  • -
  • Rajiv Tirumalareddy
  • -
  • Randall Randall
  • -
  • Ray
  • -
  • Richard D. Worth
  • -
  • Richard Feldman
  • -
  • Richard Livesey
  • -
  • Ryan Seddon
  • -
  • Sahat Yalkabov
  • -
  • Sander Spies
  • -
  • Sean Kinsey
  • -
  • Sebastian Markbåge
  • -
  • Shaun Trennery
  • -
  • Simon Højberg
  • -
  • Stefan Dombrowski
  • -
  • Stephen Murphy
  • -
  • Stoyan Stefanov
  • -
  • Sundeep Malladi
  • -
  • Sven Helmberger
  • -
  • Thomas Aylott
  • -
  • Thomas Boyt
  • -
  • Thomas Shaddox
  • -
  • Thomas Shafer
  • -
  • Timothy Yung
  • -
  • Tom Haggie
  • -
  • Tom Occhino
  • -
  • Ville Immonen
  • -
  • Vjeux
  • -
  • Volkan Unsal
  • -
  • Wayne Larsen
  • -
  • Wincent Colaiuta
  • -
  • Yuriy Dybskiy
  • -
  • Yuval Dekel
  • -
  • Zach Bruggeman
  • -
  • davidxi
  • -
  • imagentleman
  • + {% for author in author_col %} +
  • {{ author }}
  • + {% endfor %}
+ {% endfor %}
In addition, we're grateful to [Jeff Barczewski](https://github.com/jeffbski) for allowing us to use the [react](https://www.npmjs.org/package/react) package name on npm and to [Christopher Aue](http://christopheraue.net/) for letting us use the [reactjs.com](http://reactjs.com/) domain name and the [@reactjs](https://twitter.com/reactjs) username on Twitter. From fdf97f42f747c79dfc7a04d609f06c7c3bd5ab2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20O=E2=80=99Shannessy?= Date: Wed, 13 Aug 2014 12:34:56 -0700 Subject: [PATCH 8/8] Update README to use bundle exec * Also, referenced rake release task --- docs/README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/README.md b/docs/README.md index 48b36c390ed..e7cb24c71db 100644 --- a/docs/README.md +++ b/docs/README.md @@ -32,8 +32,8 @@ Use Jekyll to serve the website locally (by default, at `http://localhost:4000`) ```sh $ cd react/docs -$ rake -$ jekyll serve -w +$ bundle exec rake +$ bundle exec jekyll serve -w $ open http://localhost:4000/react/ ``` @@ -43,10 +43,9 @@ If you want to modify the CSS or JS, use [Rake](http://rake.rubyforge.org/) to c ```sh $ cd react/docs -$ rake watch # Automatically compiles as needed. -# rake Manually compile CSS and JS. -# rake css Manually compile CSS, only. -# rake js Manually compile JS, only. +$ bundle exec rake watch # Automatically compiles as needed. +# bundle exec rake Manually compile CSS and JS. +# bundle exec rake js Manually compile JS, only. ``` ## Afterthoughts @@ -57,6 +56,12 @@ The easiest way to do this is to have a separate clone of this repository, check **Note:** This should only be done for new releases. You should create a tag corresponding to the release tag in the main repository. +We also have a rake task that does the same thing (without creating commits). It expects the directory structure mentioned above. + +```sh +$ bundle exec rake release +``` + ### Removing the Jekyll / Ruby Dependency In an ideal world, we would not be adding a Ruby dependency on part of our project. We would like to move towards a point where we are using React to render the website.