Compare commits
115 Commits
is-rendera
...
0.11-stabl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f6fcf385c9 | ||
|
|
a154c95ed8 | ||
|
|
5bfae83a30 | ||
|
|
c50a9b6d1c | ||
|
|
acfc20b5f1 | ||
|
|
0aeb9bd034 | ||
|
|
4a76778797 | ||
|
|
c102550bac | ||
|
|
fcde2eb88b | ||
|
|
d3d5b70896 | ||
|
|
b2ccbc363d | ||
|
|
995d0e588b | ||
|
|
ce0354346c | ||
|
|
8c7cf04341 | ||
|
|
c8d5106387 | ||
|
|
e179f7b19e | ||
|
|
4ba83e17f7 | ||
|
|
d68fb9bd69 | ||
|
|
b814697ce3 | ||
|
|
d15620ab51 | ||
|
|
6a1194c2f2 | ||
|
|
6d90cba9ed | ||
|
|
00c178f1d5 | ||
|
|
fbb6e0caa7 | ||
|
|
b287e82818 | ||
|
|
9f2dc364e0 | ||
|
|
9ee5eda475 | ||
|
|
a0a8c6fc91 | ||
|
|
3e2ea64684 | ||
|
|
99a45a59cc | ||
|
|
732ffad313 | ||
|
|
3845e214a4 | ||
|
|
530201526a | ||
|
|
55e216cae8 | ||
|
|
94643c8225 | ||
|
|
fc499aa5f7 | ||
|
|
99632781fd | ||
|
|
ad52ef949f | ||
|
|
c86c9d15df | ||
|
|
eef717ced7 | ||
|
|
bb9f22787d | ||
|
|
3ea1b517d7 | ||
|
|
61a9d686ee | ||
|
|
f1389a8859 | ||
|
|
6adc67c4c9 | ||
|
|
4adeaed871 | ||
|
|
5b2341fa58 | ||
|
|
db1d5d263f | ||
|
|
120457b465 | ||
|
|
ca87d5d9da | ||
|
|
593e67f9b0 | ||
|
|
78f6c07cd2 | ||
|
|
e9f40faf8e | ||
|
|
2eba8f5a9e | ||
|
|
be5e3c5ef4 | ||
|
|
f77df86595 | ||
|
|
5a181591f8 | ||
|
|
0dd329370a | ||
|
|
73d5012e1d | ||
|
|
e6768e5039 | ||
|
|
70bc593b05 | ||
|
|
fd9b0a8de6 | ||
|
|
9a1f997f74 | ||
|
|
6eaaf37e44 | ||
|
|
e6791bcd91 | ||
|
|
719198f51f | ||
|
|
b8d28a73a5 | ||
|
|
bc612fb375 | ||
|
|
2c3460b8db | ||
|
|
66e22a9acf | ||
|
|
2c40e8c98b | ||
|
|
97376ba1ba | ||
|
|
4fe7d32f29 | ||
|
|
d26961562b | ||
|
|
8fcf04aa73 | ||
|
|
89872fcb30 | ||
|
|
9ebc6477fc | ||
|
|
8b2844203c | ||
|
|
57774a7b6a | ||
|
|
a4e8cc1fe4 | ||
|
|
d0f83ed8ea | ||
|
|
b3248327b2 | ||
|
|
25caaad45c | ||
|
|
cb68cedf73 | ||
|
|
af67277dd6 | ||
|
|
7d1e091b4b | ||
|
|
1f0f89d254 | ||
|
|
aaa8ffe6b2 | ||
|
|
fc4ccdcbd8 | ||
|
|
8ce7ebe009 | ||
|
|
81245c94f4 | ||
|
|
a5efe9447d | ||
|
|
42ae273fd9 | ||
|
|
75e686a1db | ||
|
|
c006ec1b8c | ||
|
|
13cfbd1641 | ||
|
|
7e946bcb9c | ||
|
|
7cb534dc08 | ||
|
|
925f459288 | ||
|
|
067644a4ae | ||
|
|
5c4c13fcee | ||
|
|
eb6d101bae | ||
|
|
b0ab09fc30 | ||
|
|
df0a678fbb | ||
|
|
975ce371e8 | ||
|
|
a712e75e83 | ||
|
|
aabb85f849 | ||
|
|
a962487c54 | ||
|
|
c28f00c19a | ||
|
|
0ad2737713 | ||
|
|
14664ceefd | ||
|
|
e8a11eed73 | ||
|
|
d1e3e157c4 | ||
|
|
95d82cacd6 | ||
|
|
0d5e5bee3c |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -12,7 +12,6 @@ build/
|
||||
docs/code
|
||||
docs/_site
|
||||
docs/.sass-cache
|
||||
docs/css/react.css
|
||||
docs/js/*
|
||||
docs/downloads
|
||||
examples/shared/*.js
|
||||
|
||||
90
CHANGELOG.md
90
CHANGELOG.md
@@ -1,3 +1,93 @@
|
||||
## 0.11.2 (September 16, 2014)
|
||||
|
||||
### React Core
|
||||
|
||||
#### New Features
|
||||
|
||||
* Added support for `<dialog>` element and associated `open` attribute
|
||||
* Added support for `<picture>` element and associated `media` and `sizes` attributes
|
||||
* Added `React.createElement` API in preparation for React v0.12
|
||||
* `React.createDescriptor` has been deprecated as a result
|
||||
|
||||
### JSX
|
||||
|
||||
* `<picture>` is now parsed into `React.DOM.picture`
|
||||
|
||||
### React Tools
|
||||
|
||||
* Update `esprima` and `jstransform` for correctness fixes
|
||||
* The `jsx` executable now exposes a `--strip-types` flag which can be used to remove TypeScript-like type annotations
|
||||
* This option is also exposed to `require('react-tools').transform` as `stripTypes`
|
||||
|
||||
## 0.11.1 (July 24, 2014)
|
||||
|
||||
### React Core
|
||||
|
||||
#### Bug Fixes
|
||||
* `setState` can be called inside `componentWillMount` in non-DOM environments
|
||||
* `SyntheticMouseEvent.getEventModifierState` correctly renamed to `getModifierState`
|
||||
* `getModifierState` correctly returns a `boolean`
|
||||
* `getModifierState` is now correctly case sensitive
|
||||
* Empty Text node used in IE8 `innerHTML` workaround is now removed, fixing rerendering in certain cases
|
||||
|
||||
### JSX
|
||||
* Fix duplicate variable declaration in JSXTransformer (caused issues in some browsers)
|
||||
|
||||
|
||||
## 0.11.0 (July 17, 2014)
|
||||
|
||||
### React Core
|
||||
|
||||
#### Breaking Changes
|
||||
* `getDefaultProps()` is now called once per class and shared across all instances
|
||||
* `MyComponent()` now returns a descriptor, not an instance
|
||||
* `React.isValidComponent` and `React.PropTypes.component` validate *descriptors*, not component instances
|
||||
* Custom `propType` validators should return an `Error` instead of logging directly
|
||||
|
||||
#### New Features
|
||||
* Rendering to `null`
|
||||
* Keyboard events include normalized `e.key` and `e.getModifierState()` properties
|
||||
* New normalized `onBeforeInput` event
|
||||
* `React.Children.count` has been added as a helper for counting the number of children
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Re-renders are batched in more cases
|
||||
* Events: `e.view` properly normalized
|
||||
* Added Support for more HTML attributes (`coords`, `crossOrigin`, `download`, `hrefLang`, `mediaGroup`, `muted`, `scrolling`, `shape`, `srcSet`, `start`, `useMap`)
|
||||
* Improved SVG support
|
||||
* Changing `className` on a mounted SVG component now works correctly
|
||||
* Added support for elements `mask` and `tspan`
|
||||
* Added support for attributes `dx`, `dy`, `fillOpacity`, `fontFamily`, `fontSize`, `markerEnd`, `markerMid`, `markerStart`, `opacity`, `patternContentUnits`, `patternUnits`, `preserveAspectRatio`, `strokeDasharray`, `strokeOpacity`
|
||||
* CSS property names with vendor prefixes (`Webkit`, `ms`, `Moz`, `O`) are now handled properly
|
||||
* Duplicate keys no longer cause a hard error; now a warning is logged (and only one of the children with the same key is shown)
|
||||
* `img` event listeners are now unbound properly, preventing the error "Two valid but unequal nodes with the same `data-reactid`"
|
||||
* Added explicit warning when missing polyfills
|
||||
|
||||
### React With Addons
|
||||
* PureRenderMixin: a mixin which helps optimize "pure" components
|
||||
* Perf: a new set of tools to help with performance analysis
|
||||
* Update: New `$apply` command to transform values
|
||||
* TransitionGroup bug fixes with null elements, Android
|
||||
|
||||
### React NPM Module
|
||||
* Now includes the pre-built packages under `dist/`.
|
||||
* `envify` is properly listed as a dependency instead of a peer dependency
|
||||
|
||||
### JSX
|
||||
* Added support for namespaces, eg `<Components.Checkbox />`
|
||||
* JSXTransformer
|
||||
* Enable the same `harmony` features available in the command line with `<script type="text/jsx;harmony=true">`
|
||||
* Scripts are downloaded in parallel for more speed. They are still executed in order (as you would expect with normal script tags)
|
||||
* Fixed a bug preventing sourcemaps from working in Firefox
|
||||
|
||||
### React Tools Module
|
||||
* Improved readme with usage and API information
|
||||
* Improved ES6 transforms available with `--harmony` option
|
||||
* Added `--source-map-inline` option to the `jsx` executable
|
||||
* New `transformWithDetails` API which gives access to the raw sourcemap data
|
||||
|
||||
|
||||
## 0.10.0 (March 21, 2014)
|
||||
|
||||
### React Core
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# [React](http://facebook.github.io/react) [](https://travis-ci.org/facebook/react)
|
||||
# [React](http://facebook.github.io/react) [](https://travis-ci.org/facebook/react)
|
||||
|
||||
React is a JavaScript library for building user interfaces.
|
||||
|
||||
@@ -36,12 +36,12 @@ The fastest way to get started is to serve JavaScript from the CDN (also availab
|
||||
|
||||
```html
|
||||
<!-- The core React library -->
|
||||
<script src="http://fb.me/react-0.10.0.js"></script>
|
||||
<script src="http://fb.me/react-0.11.2.js"></script>
|
||||
<!-- In-browser JSX transformer, remove when pre-compiling JSX. -->
|
||||
<script src="http://fb.me/JSXTransformer-0.10.0.js"></script>
|
||||
<script src="http://fb.me/JSXTransformer-0.11.2.js"></script>
|
||||
```
|
||||
|
||||
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.10.0.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
|
||||
We've also built a [starter kit](http://facebook.github.io/react/downloads/react-0.11.2.zip) which might be useful if this is your first time using React. It includes a webpage with an example of using React with live code.
|
||||
|
||||
If you'd like to use [bower](http://bower.io), it's as easy as:
|
||||
|
||||
|
||||
6
bin/jsx
6
bin/jsx
@@ -11,6 +11,9 @@ require('commoner').version(
|
||||
}).option(
|
||||
'--harmony',
|
||||
'Turns on JS transformations such as ES6 Classes etc.'
|
||||
).option(
|
||||
'--strip-types',
|
||||
'Strips out type annotations.'
|
||||
).option(
|
||||
'--source-map-inline',
|
||||
'Embed inline sourcemap in transformed source'
|
||||
@@ -18,7 +21,8 @@ require('commoner').version(
|
||||
// This is where JSX, ES6, etc. desugaring happens.
|
||||
var options = {
|
||||
harmony: this.options.harmony,
|
||||
sourceMap: this.options.sourceMapInline
|
||||
sourceMap: this.options.sourceMapInline,
|
||||
stripTypes: this.options.stripTypes
|
||||
};
|
||||
return transform(source, options);
|
||||
});
|
||||
|
||||
14
docs/Gemfile
14
docs/Gemfile
@@ -3,19 +3,17 @@ 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'
|
||||
|
||||
# Auto redirect pages
|
||||
gem 'jekyll-redirect-from'
|
||||
|
||||
# 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'
|
||||
|
||||
@@ -1,61 +1,82 @@
|
||||
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-redirect-from (0.5.0)
|
||||
jekyll (~> 2.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)
|
||||
jekyll-redirect-from
|
||||
json
|
||||
rake
|
||||
rb-fsevent
|
||||
redcarpet
|
||||
sanitize
|
||||
sass
|
||||
sanitize (~> 2.0)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
@@ -29,9 +23,19 @@ 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"
|
||||
end
|
||||
|
||||
task :default => [:css, :js]
|
||||
task :default => [:js]
|
||||
|
||||
@@ -1,21 +1,37 @@
|
||||
---
|
||||
baseurl: /react
|
||||
name: React
|
||||
description: A JavaScript library for building user interfaces
|
||||
url: http://facebook.github.io
|
||||
permalink: /blog/:year/:month/:day/:title.html
|
||||
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
|
||||
defaults:
|
||||
- scope:
|
||||
path: ''
|
||||
type: post
|
||||
values:
|
||||
layout: post
|
||||
- scope:
|
||||
path: docs
|
||||
type: page
|
||||
values:
|
||||
layout: docs
|
||||
exclude:
|
||||
- Gemfile
|
||||
- Gemfile.lock
|
||||
- README.md
|
||||
- Rakefile
|
||||
markdown: redcarpet
|
||||
redcarpet:
|
||||
extensions:
|
||||
- fenced_code_blocks
|
||||
pygments: true
|
||||
name: React
|
||||
markdown: redcarpet
|
||||
react_version: 0.10.0
|
||||
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
|
||||
gems:
|
||||
- jekyll-redirect-from
|
||||
react_version: 0.11.2
|
||||
|
||||
@@ -6,7 +6,6 @@ $textColorLight: lighten($textColor, 20%);
|
||||
html {
|
||||
font-family: $helvetica;
|
||||
font-family: proxima-nova, $helvetica;
|
||||
font-weight: 300;
|
||||
color: $textColor;
|
||||
line-height: 1.28;
|
||||
}
|
||||
@@ -132,5 +131,3 @@ a {
|
||||
.center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
30
docs/_css/bourbon/_bourbon.scss
vendored
30
docs/_css/bourbon/_bourbon.scss
vendored
@@ -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";
|
||||
|
||||
187
docs/_css/bourbon/addons/_button.scss
vendored
187
docs/_css/bourbon/addons/_button.scss
vendored
@@ -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;
|
||||
|
||||
@if $padding == inherit {
|
||||
$padding: 7px 18px;
|
||||
}
|
||||
|
||||
@else if $style == shiny {
|
||||
@include shiny($base-color, $grayscale: true);
|
||||
}
|
||||
|
||||
@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;
|
||||
|
||||
@if $padding == #4294f0 {
|
||||
$padding: 7px 18px;
|
||||
}
|
||||
|
||||
@else if $style == shiny {
|
||||
@include shiny($base-color);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
16
docs/_css/bourbon/addons/_clearfix.scss
vendored
16
docs/_css/bourbon/addons/_clearfix.scss
vendored
@@ -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)
|
||||
|
||||
111
docs/_css/bourbon/addons/_directional-values.scss
vendored
Normal file
111
docs/_css/bourbon/addons/_directional-values.scss
vendored
Normal file
@@ -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...);
|
||||
}
|
||||
7
docs/_css/bourbon/addons/_ellipsis.scss
vendored
Normal file
7
docs/_css/bourbon/addons/_ellipsis.scss
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
@mixin ellipsis($width: 100%) {
|
||||
display: inline-block;
|
||||
max-width: $width;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
2
docs/_css/bourbon/addons/_font-family.scss
vendored
2
docs/_css/bourbon/addons/_font-family.scss
vendored
@@ -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;
|
||||
|
||||
11
docs/_css/bourbon/addons/_hide-text.scss
vendored
11
docs/_css/bourbon/addons/_hide-text.scss
vendored
@@ -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%;
|
||||
}
|
||||
}
|
||||
|
||||
64
docs/_css/bourbon/addons/_html5-input-types.scss
vendored
64
docs/_css/bourbon/addons/_html5-input-types.scss
vendored
@@ -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;
|
||||
// }
|
||||
|
||||
24
docs/_css/bourbon/addons/_position.scss
vendored
24
docs/_css/bourbon/addons/_position.scss
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
16
docs/_css/bourbon/addons/_prefixer.scss
vendored
16
docs/_css/bourbon/addons/_prefixer.scss
vendored
@@ -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;
|
||||
}
|
||||
|
||||
15
docs/_css/bourbon/addons/_retina-image.scss
vendored
15
docs/_css/bourbon/addons/_retina-image.scss
vendored
@@ -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}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
46
docs/_css/bourbon/addons/_size.scss
vendored
46
docs/_css/bourbon/addons/_size.scss
vendored
@@ -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;
|
||||
}
|
||||
@if length($size) > 1 {
|
||||
$height: nth($size, 2);
|
||||
}
|
||||
|
||||
// Width x Height
|
||||
@if length($size) == 2 {
|
||||
$width: nth($size, 1);
|
||||
$height: nth($size, 2);
|
||||
@if $height == auto or (type-of($height) == number and not unitless($height)) {
|
||||
height: $height;
|
||||
}
|
||||
|
||||
@if $width == auto {
|
||||
width: $width;
|
||||
}
|
||||
@else if not(unitless($width)) {
|
||||
width: $width;
|
||||
}
|
||||
@else if unitless($width) {
|
||||
width: $width + px;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
64
docs/_css/bourbon/addons/_triangle.scss
vendored
64
docs/_css/bourbon/addons/_triangle.scss
vendored
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
8
docs/_css/bourbon/addons/_word-wrap.scss
vendored
Normal file
8
docs/_css/bourbon/addons/_word-wrap.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
62
docs/_css/bourbon/css3/_background-image.scss
vendored
62
docs/_css/bourbon/css3/_background-image.scss
vendored
@@ -4,45 +4,39 @@
|
||||
//************************************************************************//
|
||||
|
||||
@mixin background-image($images...) {
|
||||
background-image: _add-prefix($images, webkit);
|
||||
background-image: _add-prefix($images);
|
||||
}
|
||||
$webkit-images: ();
|
||||
$spec-images: ();
|
||||
|
||||
@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
|
||||
@each $image in $images {
|
||||
$webkit-image: ();
|
||||
$spec-image: ();
|
||||
|
||||
// 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 (type-of($image) == string) {
|
||||
$url-str: str-slice($image, 0, 3);
|
||||
$gradient-type: str-slice($image, 0, 6);
|
||||
|
||||
@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)
|
||||
}
|
||||
@else {
|
||||
$gradient-args: nth(nth($images, $i), 2); // Get actual gradient (red, blue)
|
||||
@if $url-str == "url" {
|
||||
$webkit-image: $image;
|
||||
$spec-image: $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 == "linear" {
|
||||
$gradients: _linear-gradient-parser($image);
|
||||
$webkit-image: map-get($gradients, webkit-image);
|
||||
$spec-image: map-get($gradients, spec-image);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
128
docs/_css/bourbon/css3/_background.scss
vendored
128
docs/_css/bourbon/css3/_background.scss
vendored
@@ -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);
|
||||
}
|
||||
@each $background in $backgrounds {
|
||||
$webkit-background: ();
|
||||
$spec-background: ();
|
||||
$background-type: type-of($background);
|
||||
|
||||
@if $fallback-color {
|
||||
background-color: $fallback-color;
|
||||
}
|
||||
background: _background-add-prefix($backgrounds, webkit);
|
||||
background: _background-add-prefix($backgrounds);
|
||||
}
|
||||
@if $background-type == string or list {
|
||||
$background-str: if($background-type == list, nth($background, 1), $background);
|
||||
|
||||
@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;
|
||||
$url-str: str-slice($background-str, 0, 3);
|
||||
$gradient-type: str-slice($background-str, 0, 6);
|
||||
|
||||
@if $url-str == "url" {
|
||||
$webkit-background: $background;
|
||||
$spec-background: $background;
|
||||
}
|
||||
}
|
||||
}
|
||||
@return false;
|
||||
}
|
||||
|
||||
@function _background-add-prefix($backgrounds, $vendor: false) {
|
||||
$backgrounds-prefixed: ();
|
||||
|
||||
@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 shorthand is a list (gradient)
|
||||
@if $type == list {
|
||||
$first-member: nth($shorthand, 1); // Get first member of shorthand
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
$gradient-positions: _gradient-positions-parser($gradient-type, $gradient-positions);
|
||||
$gradient: _render-gradients($gradient-positions, $gradient-args, $gradient-type, $vendor);
|
||||
|
||||
// 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 == "linear" {
|
||||
$gradients: _linear-gradient-parser("#{$background}");
|
||||
$webkit-background: map-get($gradients, webkit-image);
|
||||
$spec-background: map-get($gradients, spec-image);
|
||||
}
|
||||
// Image with additional properties
|
||||
|
||||
@else if $gradient-type == "radial" {
|
||||
$gradients: _radial-gradient-parser("#{$background}");
|
||||
$webkit-background: map-get($gradients, webkit-image);
|
||||
$spec-background: map-get($gradients, spec-image);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@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"));
|
||||
@else {
|
||||
$webkit-background: $background;
|
||||
$spec-background: $background;
|
||||
}
|
||||
|
||||
$webkit-backgrounds: append($webkit-backgrounds, $webkit-background, comma);
|
||||
$spec-backgrounds: append($spec-backgrounds, $spec-background, comma);
|
||||
}
|
||||
|
||||
background: $webkit-backgrounds;
|
||||
background: $spec-backgrounds;
|
||||
}
|
||||
|
||||
82
docs/_css/bourbon/css3/_border-image.scss
vendored
82
docs/_css/bourbon/css3/_border-image.scss
vendored
@@ -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: ();
|
||||
|
||||
@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)
|
||||
@each $border in $borders {
|
||||
$webkit-border: ();
|
||||
$spec-border: ();
|
||||
$border-type: type-of($border);
|
||||
|
||||
// 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);
|
||||
}
|
||||
// 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 $border-type == string or list {
|
||||
$border-str: if($border-type == list, nth($border, 1), $border);
|
||||
|
||||
// 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);
|
||||
$url-str: str-slice($border-str, 0, 3);
|
||||
$gradient-type: str-slice($border-str, 0, 6);
|
||||
|
||||
@for $i from 2 through length($images) {
|
||||
$border-image: append($border-image, nth($images, $i));
|
||||
@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);
|
||||
}
|
||||
|
||||
@else {
|
||||
$webkit-border: $border;
|
||||
$spec-border: $border;
|
||||
}
|
||||
}
|
||||
|
||||
@else {
|
||||
$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));
|
||||
|
||||
|
||||
4
docs/_css/bourbon/css3/_calc.scss
vendored
Normal file
4
docs/_css/bourbon/css3/_calc.scss
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
@mixin calc($property, $value) {
|
||||
#{$property}: -webkit-calc(#{$value});
|
||||
#{$property}: calc(#{$value});
|
||||
}
|
||||
2
docs/_css/bourbon/css3/_columns.scss
vendored
2
docs/_css/bourbon/css3/_columns.scss
vendored
@@ -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) {
|
||||
|
||||
5
docs/_css/bourbon/css3/_filter.scss
vendored
Normal file
5
docs/_css/bourbon/css3/_filter.scss
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
@mixin filter($function: none) {
|
||||
// <filter-function> [<filter-function]* | none
|
||||
@include prefixer(filter, $function, webkit spec);
|
||||
}
|
||||
|
||||
269
docs/_css/bourbon/css3/_flex-box.scss
vendored
269
docs/_css/bourbon/css3/_flex-box.scss
vendored
@@ -11,6 +11,7 @@
|
||||
@mixin display-box {
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -ms-flexbox; // IE 10
|
||||
display: box;
|
||||
}
|
||||
|
||||
@@ -22,16 +23,19 @@
|
||||
@mixin box-pack($pack: start) {
|
||||
// start|end|center|justify
|
||||
@include prefixer(box-pack, $pack, webkit moz spec);
|
||||
-ms-flex-pack: $pack; // IE 10
|
||||
}
|
||||
|
||||
@mixin box-align($align: stretch) {
|
||||
// start|end|center|baseline|stretch
|
||||
@include prefixer(box-align, $align, webkit moz spec);
|
||||
-ms-flex-align: $align; // IE 10
|
||||
}
|
||||
|
||||
@mixin box-direction($direction: normal) {
|
||||
// normal|reverse|inherit
|
||||
@include prefixer(box-direction, $direction, webkit moz spec);
|
||||
-ms-flex-direction: $direction; // IE 10
|
||||
}
|
||||
|
||||
@mixin box-lines($lines: single) {
|
||||
@@ -41,12 +45,277 @@
|
||||
|
||||
@mixin box-ordinal-group($int: 1) {
|
||||
@include prefixer(box-ordinal-group, $int, webkit moz spec);
|
||||
-ms-flex-order: $int; // IE 10
|
||||
}
|
||||
|
||||
@mixin box-flex($value: 0.0) {
|
||||
@include prefixer(box-flex, $value, webkit moz spec);
|
||||
-ms-flex: $value; // IE 10
|
||||
}
|
||||
|
||||
@mixin box-flex-group($int: 1) {
|
||||
@include prefixer(box-flex-group, $int, webkit moz spec);
|
||||
}
|
||||
|
||||
// CSS3 Flexible Box Model and property defaults
|
||||
// Unified attributes for 2009, 2011, and 2012 flavours.
|
||||
|
||||
// 2009 - display (box | inline-box)
|
||||
// 2011 - display (flexbox | inline-flexbox)
|
||||
// 2012 - display (flex | inline-flex)
|
||||
@mixin display($value) {
|
||||
// flex | inline-flex
|
||||
@if $value == "flex" {
|
||||
// 2009
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: box;
|
||||
|
||||
// 2012
|
||||
display: -webkit-flex;
|
||||
display: -moz-flex;
|
||||
display: -ms-flexbox; // 2011 (IE 10)
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@elseif $value == "inline-flex" {
|
||||
display: -webkit-inline-box;
|
||||
display: -moz-inline-box;
|
||||
display: inline-box;
|
||||
|
||||
display: -webkit-inline-flex;
|
||||
display: -moz-inline-flex;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
@else {
|
||||
display: $value;
|
||||
}
|
||||
}
|
||||
|
||||
// 2009 - box-flex (integer)
|
||||
// 2011 - flex (decimal | width decimal)
|
||||
// 2012 - flex (integer integer width)
|
||||
@mixin flex($value) {
|
||||
|
||||
// Grab flex-grow for older browsers.
|
||||
$flex-grow: nth($value, 1);
|
||||
|
||||
// 2009
|
||||
@include prefixer(box-flex, $flex-grow, webkit moz spec);
|
||||
|
||||
// 2011 (IE 10), 2012
|
||||
@include prefixer(flex, $value, webkit moz ms spec);
|
||||
}
|
||||
|
||||
// 2009 - box-orient ( horizontal | vertical | inline-axis | block-axis)
|
||||
// - box-direction (normal | reverse)
|
||||
// 2011 - flex-direction (row | row-reverse | column | column-reverse)
|
||||
// 2012 - flex-direction (row | row-reverse | column | column-reverse)
|
||||
@mixin flex-direction($value: row) {
|
||||
|
||||
// Alt values.
|
||||
$value-2009: $value;
|
||||
$value-2011: $value;
|
||||
$direction: "normal";
|
||||
|
||||
@if $value == row {
|
||||
$value-2009: horizontal;
|
||||
}
|
||||
|
||||
@elseif $value == "row-reverse" {
|
||||
$value-2009: horizontal;
|
||||
$direction: reverse;
|
||||
}
|
||||
|
||||
@elseif $value == column {
|
||||
$value-2009: vertical;
|
||||
}
|
||||
|
||||
@elseif $value == "column-reverse" {
|
||||
$value-2009: vertical;
|
||||
$direction: reverse;
|
||||
}
|
||||
|
||||
// 2009
|
||||
@include prefixer(box-orient, $value-2009, webkit moz spec);
|
||||
@if $direction == "reverse" {
|
||||
@include prefixer(box-direction, $direction, webkit moz spec);
|
||||
}
|
||||
|
||||
// 2012
|
||||
@include prefixer(flex-direction, $value, webkit moz spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-direction: $value;
|
||||
}
|
||||
|
||||
// 2009 - box-lines (single | multiple)
|
||||
// 2011 - flex-wrap (nowrap | wrap | wrap-reverse)
|
||||
// 2012 - flex-wrap (nowrap | wrap | wrap-reverse)
|
||||
@mixin flex-wrap($value: nowrap) {
|
||||
|
||||
// Alt values.
|
||||
$alt-value: $value;
|
||||
@if $value == nowrap {
|
||||
$alt-value: single;
|
||||
}
|
||||
|
||||
@elseif $value == wrap {
|
||||
$alt-value: multiple;
|
||||
}
|
||||
|
||||
@elseif $value == "wrap-reverse" {
|
||||
$alt-value: multiple;
|
||||
}
|
||||
|
||||
@include prefixer(box-lines, $alt-value, webkit moz spec);
|
||||
@include prefixer(flex-wrap, $value, webkit moz ms spec);
|
||||
}
|
||||
|
||||
// 2009 - TODO: parse values into flex-direction/flex-wrap
|
||||
// 2011 - TODO: parse values into flex-direction/flex-wrap
|
||||
// 2012 - flex-flow (flex-direction || flex-wrap)
|
||||
@mixin flex-flow($value) {
|
||||
@include prefixer(flex-flow, $value, webkit moz spec);
|
||||
}
|
||||
|
||||
// 2009 - box-ordinal-group (integer)
|
||||
// 2011 - flex-order (integer)
|
||||
// 2012 - order (integer)
|
||||
@mixin order($int: 0) {
|
||||
// 2009
|
||||
@include prefixer(box-ordinal-group, $int, webkit moz spec);
|
||||
|
||||
// 2012
|
||||
@include prefixer(order, $int, webkit moz spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-order: $int;
|
||||
}
|
||||
|
||||
// 2012 - flex-grow (number)
|
||||
@mixin flex-grow($number: 0) {
|
||||
@include prefixer(flex-grow, $number, webkit moz spec);
|
||||
-ms-flex-positive: $number;
|
||||
}
|
||||
|
||||
// 2012 - flex-shrink (number)
|
||||
@mixin flex-shrink($number: 1) {
|
||||
@include prefixer(flex-shrink, $number, webkit moz spec);
|
||||
-ms-flex-negative: $number;
|
||||
}
|
||||
|
||||
// 2012 - flex-basis (number)
|
||||
@mixin flex-basis($width: auto) {
|
||||
@include prefixer(flex-basis, $width, webkit moz spec);
|
||||
-ms-flex-preferred-size: $width;
|
||||
}
|
||||
|
||||
// 2009 - box-pack (start | end | center | justify)
|
||||
// 2011 - flex-pack (start | end | center | justify)
|
||||
// 2012 - justify-content (flex-start | flex-end | center | space-between | space-around)
|
||||
@mixin justify-content ($value: flex-start) {
|
||||
|
||||
// Alt values.
|
||||
$alt-value: $value;
|
||||
@if $value == "flex-start" {
|
||||
$alt-value: start;
|
||||
}
|
||||
|
||||
@elseif $value == "flex-end" {
|
||||
$alt-value: end;
|
||||
}
|
||||
|
||||
@elseif $value == "space-between" {
|
||||
$alt-value: justify;
|
||||
}
|
||||
|
||||
@elseif $value == "space-around" {
|
||||
$alt-value: center;
|
||||
}
|
||||
|
||||
// 2009
|
||||
@include prefixer(box-pack, $alt-value, webkit moz spec);
|
||||
|
||||
// 2012
|
||||
@include prefixer(justify-content, $value, webkit moz ms o spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-pack: $alt-value;
|
||||
}
|
||||
|
||||
// 2009 - box-align (start | end | center | baseline | stretch)
|
||||
// 2011 - flex-align (start | end | center | baseline | stretch)
|
||||
// 2012 - align-items (flex-start | flex-end | center | baseline | stretch)
|
||||
@mixin align-items($value: stretch) {
|
||||
|
||||
$alt-value: $value;
|
||||
|
||||
@if $value == "flex-start" {
|
||||
$alt-value: start;
|
||||
}
|
||||
|
||||
@elseif $value == "flex-end" {
|
||||
$alt-value: end;
|
||||
}
|
||||
|
||||
// 2009
|
||||
@include prefixer(box-align, $alt-value, webkit moz spec);
|
||||
|
||||
// 2012
|
||||
@include prefixer(align-items, $value, webkit moz ms o spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-align: $alt-value;
|
||||
}
|
||||
|
||||
// 2011 - flex-item-align (auto | start | end | center | baseline | stretch)
|
||||
// 2012 - align-self (auto | flex-start | flex-end | center | baseline | stretch)
|
||||
@mixin align-self($value: auto) {
|
||||
|
||||
$value-2011: $value;
|
||||
@if $value == "flex-start" {
|
||||
$value-2011: start;
|
||||
}
|
||||
|
||||
@elseif $value == "flex-end" {
|
||||
$value-2011: end;
|
||||
}
|
||||
|
||||
// 2012
|
||||
@include prefixer(align-self, $value, webkit moz spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-item-align: $value-2011;
|
||||
}
|
||||
|
||||
// 2011 - flex-line-pack (start | end | center | justify | distribute | stretch)
|
||||
// 2012 - align-content (flex-start | flex-end | center | space-between | space-around | stretch)
|
||||
@mixin align-content($value: stretch) {
|
||||
|
||||
$value-2011: $value;
|
||||
@if $value == "flex-start" {
|
||||
$value-2011: start;
|
||||
}
|
||||
|
||||
@elseif $value == "flex-end" {
|
||||
$value-2011: end;
|
||||
}
|
||||
|
||||
@elseif $value == "space-between" {
|
||||
$value-2011: justify;
|
||||
}
|
||||
|
||||
@elseif $value == "space-around" {
|
||||
$value-2011: distribute;
|
||||
}
|
||||
|
||||
// 2012
|
||||
@include prefixer(align-content, $value, webkit moz spec);
|
||||
|
||||
// 2011 (IE 10)
|
||||
-ms-flex-line-pack: $value-2011;
|
||||
}
|
||||
|
||||
|
||||
2
docs/_css/bourbon/css3/_font-face.scss
vendored
2
docs/_css/bourbon/css3/_font-face.scss
vendored
@@ -1,6 +1,6 @@
|
||||
// Order of the includes matters, and it is: normal, bold, italic, bold+italic.
|
||||
|
||||
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: false ) {
|
||||
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal, $asset-pipeline: $asset-pipeline) {
|
||||
@font-face {
|
||||
font-family: $font-family;
|
||||
font-weight: $weight;
|
||||
|
||||
10
docs/_css/bourbon/css3/_font-feature-settings.scss
vendored
Normal file
10
docs/_css/bourbon/css3/_font-feature-settings.scss
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
// Font feature settings mixin and property default.
|
||||
// Examples: @include font-feature-settings("liga");
|
||||
// @include font-feature-settings("lnum" false);
|
||||
// @include font-feature-settings("pnum" 1, "kern" 0);
|
||||
// @include font-feature-settings("ss01", "ss02");
|
||||
|
||||
@mixin font-feature-settings($settings...) {
|
||||
@if length($settings) == 0 { $settings: none; }
|
||||
@include prefixer(font-feature-settings, $settings, webkit moz ms spec);
|
||||
}
|
||||
4
docs/_css/bourbon/css3/_hyphens.scss
vendored
Normal file
4
docs/_css/bourbon/css3/_hyphens.scss
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
@mixin hyphens($hyphenation: none) {
|
||||
// none | manual | auto
|
||||
@include prefixer(hyphens, $hyphenation, webkit moz ms spec);
|
||||
}
|
||||
7
docs/_css/bourbon/css3/_image-rendering.scss
vendored
7
docs/_css/bourbon/css3/_image-rendering.scss
vendored
@@ -1,10 +1,11 @@
|
||||
@mixin image-rendering ($mode:optimizeQuality) {
|
||||
@mixin image-rendering ($mode:auto) {
|
||||
|
||||
@if ($mode == optimize-contrast) {
|
||||
@if ($mode == crisp-edges) {
|
||||
-ms-interpolation-mode: nearest-neighbor; // IE8+
|
||||
image-rendering: -moz-crisp-edges;
|
||||
image-rendering: -o-crisp-edges;
|
||||
image-rendering: -webkit-optimize-contrast;
|
||||
image-rendering: optimize-contrast;
|
||||
image-rendering: crisp-edges;
|
||||
}
|
||||
|
||||
@else {
|
||||
|
||||
8
docs/_css/bourbon/css3/_inline-block.scss
vendored
8
docs/_css/bourbon/css3/_inline-block.scss
vendored
@@ -1,8 +0,0 @@
|
||||
// Legacy support for inline-block in IE7 (maybe IE6)
|
||||
@mixin inline-block {
|
||||
display: inline-block;
|
||||
vertical-align: baseline;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
*vertical-align: auto;
|
||||
}
|
||||
26
docs/_css/bourbon/css3/_keyframes.scss
vendored
26
docs/_css/bourbon/css3/_keyframes.scss
vendored
@@ -8,36 +8,28 @@
|
||||
|
||||
@if $original-prefix-for-webkit {
|
||||
@include disable-prefix-for-all();
|
||||
$prefix-for-webkit: true;
|
||||
$prefix-for-webkit: true !global;
|
||||
@-webkit-keyframes #{$name} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@if $original-prefix-for-mozilla {
|
||||
@include disable-prefix-for-all();
|
||||
$prefix-for-mozilla: true;
|
||||
$prefix-for-mozilla: true !global;
|
||||
@-moz-keyframes #{$name} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@if $original-prefix-for-opera {
|
||||
@include disable-prefix-for-all();
|
||||
$prefix-for-opera: true;
|
||||
@-o-keyframes #{$name} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
$prefix-for-webkit: $original-prefix-for-webkit !global;
|
||||
$prefix-for-mozilla: $original-prefix-for-mozilla !global;
|
||||
$prefix-for-microsoft: $original-prefix-for-microsoft !global;
|
||||
$prefix-for-opera: $original-prefix-for-opera !global;
|
||||
$prefix-for-spec: $original-prefix-for-spec !global;
|
||||
|
||||
@if $original-prefix-for-spec {
|
||||
@include disable-prefix-for-all();
|
||||
$prefix-for-spec: true;
|
||||
@keyframes #{$name} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
|
||||
$prefix-for-webkit: $original-prefix-for-webkit;
|
||||
$prefix-for-mozilla: $original-prefix-for-mozilla;
|
||||
$prefix-for-microsoft: $original-prefix-for-microsoft;
|
||||
$prefix-for-opera: $original-prefix-for-opera;
|
||||
$prefix-for-spec: $original-prefix-for-spec;
|
||||
}
|
||||
|
||||
17
docs/_css/bourbon/css3/_linear-gradient.scss
vendored
17
docs/_css/bourbon/css3/_linear-gradient.scss
vendored
@@ -1,11 +1,9 @@
|
||||
@mixin linear-gradient($pos, $G1, $G2: false,
|
||||
$G3: false, $G4: false,
|
||||
$G5: false, $G6: false,
|
||||
$G7: false, $G8: false,
|
||||
$G9: false, $G10: false,
|
||||
$deprecated-pos1: left top,
|
||||
$deprecated-pos2: left bottom,
|
||||
$fallback: false) {
|
||||
@mixin linear-gradient($pos, $G1, $G2: null,
|
||||
$G3: null, $G4: null,
|
||||
$G5: null, $G6: null,
|
||||
$G7: null, $G8: null,
|
||||
$G9: null, $G10: null,
|
||||
$fallback: null) {
|
||||
// Detect what type of value exists in $pos
|
||||
$pos-type: type-of(nth($pos, 1));
|
||||
$pos-spec: null;
|
||||
@@ -24,7 +22,7 @@
|
||||
$pos-spec: nth($positions, 2);
|
||||
}
|
||||
|
||||
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
|
||||
$full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
|
||||
|
||||
// Set $G1 as the default fallback color
|
||||
$fallback-color: nth($G1, 1);
|
||||
@@ -35,7 +33,6 @@
|
||||
}
|
||||
|
||||
background-color: $fallback-color;
|
||||
background-image: _deprecated-webkit-gradient(linear, $deprecated-pos1, $deprecated-pos2, $full); // Safari <= 5.0
|
||||
background-image: -webkit-linear-gradient($pos-degree $full); // Safari 5.1+, Chrome
|
||||
background-image: unquote("linear-gradient(#{$pos-spec}#{$full})");
|
||||
}
|
||||
|
||||
27
docs/_css/bourbon/css3/_placeholder.scss
vendored
27
docs/_css/bourbon/css3/_placeholder.scss
vendored
@@ -1,29 +1,8 @@
|
||||
$placeholders: '-webkit-input-placeholder',
|
||||
'-moz-placeholder',
|
||||
'-ms-input-placeholder';
|
||||
|
||||
@mixin placeholder {
|
||||
$placeholders: ":-webkit-input" ":-moz" "-moz" "-ms-input";
|
||||
@each $placeholder in $placeholders {
|
||||
@if $placeholder == "-webkit-input-placeholder" {
|
||||
&::#{$placeholder} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@else if $placeholder == "-moz-placeholder" {
|
||||
// FF 18-
|
||||
&:#{$placeholder} {
|
||||
@content;
|
||||
}
|
||||
|
||||
// FF 19+
|
||||
&::#{$placeholder} {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
@else {
|
||||
&:#{$placeholder} {
|
||||
@content;
|
||||
}
|
||||
&:#{$placeholder}-placeholder {
|
||||
@content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
17
docs/_css/bourbon/css3/_radial-gradient.scss
vendored
17
docs/_css/bourbon/css3/_radial-gradient.scss
vendored
@@ -1,16 +1,12 @@
|
||||
// Requires Sass 3.1+
|
||||
@mixin radial-gradient($G1, $G2,
|
||||
$G3: false, $G4: false,
|
||||
$G5: false, $G6: false,
|
||||
$G7: false, $G8: false,
|
||||
$G9: false, $G10: false,
|
||||
$G3: null, $G4: null,
|
||||
$G5: null, $G6: null,
|
||||
$G7: null, $G8: null,
|
||||
$G9: null, $G10: null,
|
||||
$pos: null,
|
||||
$shape-size: null,
|
||||
$deprecated-pos1: center center,
|
||||
$deprecated-pos2: center center,
|
||||
$deprecated-radius1: 0,
|
||||
$deprecated-radius2: 460,
|
||||
$fallback: false) {
|
||||
$fallback: null) {
|
||||
|
||||
$data: _radial-arg-parser($G1, $G2, $pos, $shape-size);
|
||||
$G1: nth($data, 1);
|
||||
@@ -18,7 +14,7 @@
|
||||
$pos: nth($data, 3);
|
||||
$shape-size: nth($data, 4);
|
||||
|
||||
$full: compact($G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10);
|
||||
$full: $G1, $G2, $G3, $G4, $G5, $G6, $G7, $G8, $G9, $G10;
|
||||
|
||||
// Strip deprecated cover/contain for spec
|
||||
$shape-size-spec: _shape-size-stripper($shape-size);
|
||||
@@ -38,7 +34,6 @@
|
||||
$shape-size-spec: if(($shape-size-spec != ' ') and ($pos == null), '#{$shape-size-spec}, ', '#{$shape-size-spec} ');
|
||||
|
||||
background-color: $fallback-color;
|
||||
background-image: _deprecated-webkit-gradient(radial, $deprecated-pos1, $deprecated-pos2, $full, $deprecated-radius1, $deprecated-radius2); // Safari <= 5.0 && IOS 4
|
||||
background-image: -webkit-radial-gradient(unquote(#{$pos}#{$shape-size}#{$full}));
|
||||
background-image: unquote("radial-gradient(#{$shape-size-spec}#{$pos-spec}#{$full})");
|
||||
}
|
||||
|
||||
57
docs/_css/bourbon/css3/_transition.scss
vendored
57
docs/_css/bourbon/css3/_transition.scss
vendored
@@ -1,16 +1,59 @@
|
||||
// Shorthand mixin. Supports multiple parentheses-deliminated values for each variable.
|
||||
// Example: @include transition (all, 2.0s, ease-in-out);
|
||||
// @include transition ((opacity, width), (1.0s, 2.0s), ease-in, (0, 2s));
|
||||
// @include transition ($property:(opacity, width), $delay: (1.5s, 2.5s));
|
||||
// Example: @include transition (all 2s ease-in-out);
|
||||
// @include transition (opacity 1s ease-in 2s, width 2s ease-out);
|
||||
// @include transition-property (transform, opacity);
|
||||
|
||||
@mixin transition ($properties...) {
|
||||
@if length($properties) >= 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
docs/_css/bourbon/functions/_assign.scss
vendored
Normal file
11
docs/_css/bourbon/functions/_assign.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
13
docs/_css/bourbon/functions/_color-lightness.scss
vendored
Normal file
13
docs/_css/bourbon/functions/_color-lightness.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
11
docs/_css/bourbon/functions/_compact.scss
vendored
11
docs/_css/bourbon/functions/_compact.scss
vendored
@@ -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;
|
||||
}
|
||||
3
docs/_css/bourbon/functions/_golden-ratio.scss
vendored
Normal file
3
docs/_css/bourbon/functions/_golden-ratio.scss
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
@function golden-ratio($value, $increment) {
|
||||
@return modular-scale($value, $increment, $golden)
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
82
docs/_css/bourbon/functions/_modular-scale.scss
vendored
82
docs/_css/bourbon/functions/_modular-scale.scss
vendored
@@ -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
|
||||
|
||||
9
docs/_css/bourbon/functions/_px-to-em.scss
vendored
9
docs/_css/bourbon/functions/_px-to-em.scss
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
15
docs/_css/bourbon/functions/_px-to-rem.scss
vendored
Normal file
15
docs/_css/bourbon/functions/_px-to-rem.scss
vendored
Normal file
@@ -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 <html>
|
||||
|
||||
@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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
5
docs/_css/bourbon/functions/_strip-units.scss
vendored
Normal file
5
docs/_css/bourbon/functions/_strip-units.scss
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
// Srtips the units from a value. e.g. 12px -> 12
|
||||
|
||||
@function strip-units($val) {
|
||||
@return ($val / ($val * 0 + 1));
|
||||
}
|
||||
17
docs/_css/bourbon/functions/_unpack.scss
vendored
Normal file
17
docs/_css/bourbon/functions/_unpack.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
15
docs/_css/bourbon/helpers/_convert-units.scss
vendored
Normal file
15
docs/_css/bourbon/helpers/_convert-units.scss
vendored
Normal file
@@ -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);
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
8
docs/_css/bourbon/helpers/_is-num.scss
vendored
Normal file
8
docs/_css/bourbon/helpers/_is-num.scss
vendored
Normal file
@@ -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);
|
||||
}
|
||||
25
docs/_css/bourbon/helpers/_linear-angle-parser.scss
vendored
Normal file
25
docs/_css/bourbon/helpers/_linear-angle-parser.scss
vendored
Normal file
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
41
docs/_css/bourbon/helpers/_linear-gradient-parser.scss
vendored
Normal file
41
docs/_css/bourbon/helpers/_linear-gradient-parser.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
31
docs/_css/bourbon/helpers/_linear-side-corner-parser.scss
vendored
Normal file
31
docs/_css/bourbon/helpers/_linear-side-corner-parser.scss
vendored
Normal file
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
50
docs/_css/bourbon/helpers/_radial-gradient-parser.scss
vendored
Normal file
50
docs/_css/bourbon/helpers/_radial-gradient-parser.scss
vendored
Normal file
@@ -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;
|
||||
}
|
||||
50
docs/_css/bourbon/helpers/_str-to-num.scss
vendored
Normal file
50
docs/_css/bourbon/helpers/_str-to-num.scss
vendored
Normal file
@@ -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);
|
||||
}
|
||||
1
docs/_css/bourbon/settings/_asset-pipeline.scss
vendored
Normal file
1
docs/_css/bourbon/settings/_asset-pipeline.scss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
$asset-pipeline: false !default;
|
||||
6
docs/_css/bourbon/settings/_prefixer.scss
vendored
Normal file
6
docs/_css/bourbon/settings/_prefixer.scss
vendored
Normal file
@@ -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
|
||||
1
docs/_css/bourbon/settings/_px-to-em.scss
vendored
Normal file
1
docs/_css/bourbon/settings/_px-to-em.scss
vendored
Normal file
@@ -0,0 +1 @@
|
||||
$em-base: 16px !default;
|
||||
179
docs/_data/acknowledgements.yml
Normal file
179
docs/_data/acknowledgements.yml
Normal file
@@ -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
|
||||
@@ -81,5 +81,7 @@
|
||||
items:
|
||||
- id: flux-overview
|
||||
title: Flux Overview
|
||||
href: http://facebook.github.io/flux/docs/overview.html
|
||||
- id: flux-todo-list
|
||||
title: Flux Todo List
|
||||
title: Flux TodoMVC Tutorial
|
||||
href: http://facebook.github.io/flux/docs/todo-list.html
|
||||
|
||||
@@ -6,16 +6,12 @@
|
||||
<ul>
|
||||
{% for item in section.items %}
|
||||
<li>
|
||||
<a href="/react/docs/{{ item.id }}.html"{% if page.id == item.id %} class="active"{% endif %}>
|
||||
{{ item.title }}
|
||||
</a>
|
||||
{{ item | sidebar_item_link}}
|
||||
{% if item.subitems %}
|
||||
<ul>
|
||||
{% for subitem in item.subitems %}
|
||||
<li>
|
||||
<a href="/react/docs/{{ subitem.id }}.html"{% if page.id == subitem.id %} class="active"{% endif %}>
|
||||
{{ subitem.title }}
|
||||
</a>
|
||||
{{ subitem | sidebar_item_link}}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -1,482 +1,7 @@
|
||||
/**
|
||||
* Copyright 2013-2014 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* This is a very simple HTML to JSX converter. It turns out that browsers
|
||||
* have good HTML parsers (who would have thought?) so we utilise this by
|
||||
* inserting the HTML into a temporary DOM node, and then do a breadth-first
|
||||
* traversal of the resulting DOM tree.
|
||||
*/
|
||||
;(function(global) {
|
||||
'use strict';
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Node.nodeType
|
||||
var NODE_TYPE = {
|
||||
ELEMENT: 1,
|
||||
TEXT: 3,
|
||||
COMMENT: 8
|
||||
};
|
||||
var ATTRIBUTE_MAPPING = {
|
||||
'for': 'htmlFor',
|
||||
'class': 'className'
|
||||
};
|
||||
|
||||
/**
|
||||
* Repeats a string a certain number of times.
|
||||
* Also: the future is bright and consists of native string repetition:
|
||||
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
|
||||
*
|
||||
* @param {string} string String to repeat
|
||||
* @param {number} times Number of times to repeat string. Integer.
|
||||
* @see http://jsperf.com/string-repeater/2
|
||||
*/
|
||||
function repeatString(string, times) {
|
||||
if (times === 1) {
|
||||
return string;
|
||||
}
|
||||
if (times < 0) { throw new Error(); }
|
||||
var repeated = '';
|
||||
while (times) {
|
||||
if (times & 1) {
|
||||
repeated += string;
|
||||
}
|
||||
if (times >>= 1) {
|
||||
string += string;
|
||||
}
|
||||
}
|
||||
return repeated;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the string ends with the specified substring.
|
||||
*
|
||||
* @param {string} haystack String to search in
|
||||
* @param {string} needle String to search for
|
||||
* @return {boolean}
|
||||
*/
|
||||
function endsWith(haystack, needle) {
|
||||
return haystack.slice(-needle.length) === needle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trim the specified substring off the string. If the string does not end
|
||||
* with the specified substring, this is a no-op.
|
||||
*
|
||||
* @param {string} haystack String to search in
|
||||
* @param {string} needle String to search for
|
||||
* @return {string}
|
||||
*/
|
||||
function trimEnd(haystack, needle) {
|
||||
return endsWith(haystack, needle)
|
||||
? haystack.slice(0, -needle.length)
|
||||
: haystack;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a hyphenated string to camelCase.
|
||||
*/
|
||||
function hyphenToCamelCase(string) {
|
||||
return string.replace(/-(.)/g, function(match, chr) {
|
||||
return chr.toUpperCase();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the specified string consists entirely of whitespace.
|
||||
*/
|
||||
function isEmpty(string) {
|
||||
return !/[^\s]/.test(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the specified string consists entirely of numeric characters.
|
||||
*/
|
||||
function isNumeric(input) {
|
||||
return input !== undefined
|
||||
&& input !== null
|
||||
&& (typeof input === 'number' || parseInt(input, 10) == input);
|
||||
}
|
||||
|
||||
var HTMLtoJSX = function(config) {
|
||||
this.config = config || {};
|
||||
|
||||
if (this.config.createClass === undefined) {
|
||||
this.config.createClass = true;
|
||||
}
|
||||
if (!this.config.indent) {
|
||||
this.config.indent = ' ';
|
||||
}
|
||||
if (!this.config.outputClassName) {
|
||||
this.config.outputClassName = 'NewComponent';
|
||||
}
|
||||
};
|
||||
HTMLtoJSX.prototype = {
|
||||
/**
|
||||
* Reset the internal state of the converter
|
||||
*/
|
||||
reset: function() {
|
||||
this.output = '';
|
||||
this.level = 0;
|
||||
},
|
||||
/**
|
||||
* Main entry point to the converter. Given the specified HTML, returns a
|
||||
* JSX object representing it.
|
||||
* @param {string} html HTML to convert
|
||||
* @return {string} JSX
|
||||
*/
|
||||
convert: function(html) {
|
||||
this.reset();
|
||||
|
||||
// It turns out browsers have good HTML parsers (imagine that).
|
||||
// Let's take advantage of it.
|
||||
var containerEl = document.createElement('div');
|
||||
containerEl.innerHTML = '\n' + this._cleanInput(html) + '\n';
|
||||
|
||||
if (this.config.createClass) {
|
||||
if (this.config.outputClassName) {
|
||||
this.output = 'var ' + this.config.outputClassName + ' = React.createClass({\n';
|
||||
} else {
|
||||
this.output = 'React.createClass({\n';
|
||||
}
|
||||
this.output += this.config.indent + 'render: function() {' + "\n";
|
||||
this.output += this.config.indent + this.config.indent + 'return (\n';
|
||||
}
|
||||
|
||||
if (this._onlyOneTopLevel(containerEl)) {
|
||||
// Only one top-level element, the component can return it directly
|
||||
// No need to actually visit the container element
|
||||
this._traverse(containerEl);
|
||||
} else {
|
||||
// More than one top-level element, need to wrap the whole thing in a
|
||||
// container.
|
||||
this.output += this.config.indent + this.config.indent + this.config.indent;
|
||||
this.level++;
|
||||
this._visit(containerEl);
|
||||
}
|
||||
this.output = this.output.trim() + '\n';
|
||||
if (this.config.createClass) {
|
||||
this.output += this.config.indent + this.config.indent + ');\n';
|
||||
this.output += this.config.indent + '}\n';
|
||||
this.output += '});';
|
||||
}
|
||||
return this.output;
|
||||
},
|
||||
|
||||
/**
|
||||
* Cleans up the specified HTML so it's in a format acceptable for
|
||||
* converting.
|
||||
*
|
||||
* @param {string} html HTML to clean
|
||||
* @return {string} Cleaned HTML
|
||||
*/
|
||||
_cleanInput: function(html) {
|
||||
// Remove unnecessary whitespace
|
||||
html = html.trim();
|
||||
// Ugly method to strip script tags. They can wreak havoc on the DOM nodes
|
||||
// so let's not even put them in the DOM.
|
||||
html = html.replace(/<script(.*?)<\/script>/g, '');
|
||||
return html;
|
||||
},
|
||||
|
||||
/**
|
||||
* Determines if there's only one top-level node in the DOM tree. That is,
|
||||
* all the HTML is wrapped by a single HTML tag.
|
||||
*
|
||||
* @param {DOMElement} containerEl Container element
|
||||
* @return {boolean}
|
||||
*/
|
||||
_onlyOneTopLevel: function(containerEl) {
|
||||
// Only a single child element
|
||||
if (
|
||||
containerEl.childNodes.length === 1
|
||||
&& containerEl.childNodes[0].nodeType === NODE_TYPE.ELEMENT
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// Only one element, and all other children are whitespace
|
||||
var foundElement = false;
|
||||
for (var i = 0, count = containerEl.childNodes.length; i < count; i++) {
|
||||
var child = containerEl.childNodes[i];
|
||||
if (child.nodeType === NODE_TYPE.ELEMENT) {
|
||||
if (foundElement) {
|
||||
// Encountered an element after already encountering another one
|
||||
// Therefore, more than one element at root level
|
||||
return false;
|
||||
} else {
|
||||
foundElement = true;
|
||||
}
|
||||
} else if (child.nodeType === NODE_TYPE.TEXT && !isEmpty(child.textContent)) {
|
||||
// Contains text content
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a newline followed by the correct indentation for the current
|
||||
* nesting level
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
_getIndentedNewline: function() {
|
||||
return '\n' + repeatString(this.config.indent, this.level + 2);
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles processing the specified node
|
||||
*
|
||||
* @param {Node} node
|
||||
*/
|
||||
_visit: function(node) {
|
||||
this._beginVisit(node);
|
||||
this._traverse(node);
|
||||
this._endVisit(node);
|
||||
},
|
||||
|
||||
/**
|
||||
* Traverses all the children of the specified node
|
||||
*
|
||||
* @param {Node} node
|
||||
*/
|
||||
_traverse: function(node) {
|
||||
this.level++;
|
||||
for (var i = 0, count = node.childNodes.length; i < count; i++) {
|
||||
this._visit(node.childNodes[i]);
|
||||
}
|
||||
this.level--;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle pre-visit behaviour for the specified node.
|
||||
*
|
||||
* @param {Node} node
|
||||
*/
|
||||
_beginVisit: function(node) {
|
||||
switch (node.nodeType) {
|
||||
case NODE_TYPE.ELEMENT:
|
||||
this._beginVisitElement(node);
|
||||
break;
|
||||
|
||||
case NODE_TYPE.TEXT:
|
||||
this._visitText(node);
|
||||
break;
|
||||
|
||||
case NODE_TYPE.COMMENT:
|
||||
this._visitComment(node);
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn('Unrecognised node type: ' + node.nodeType);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles post-visit behaviour for the specified node.
|
||||
*
|
||||
* @param {Node} node
|
||||
*/
|
||||
_endVisit: function(node) {
|
||||
switch (node.nodeType) {
|
||||
case NODE_TYPE.ELEMENT:
|
||||
this._endVisitElement(node);
|
||||
break;
|
||||
// No ending tags required for these types
|
||||
case NODE_TYPE.TEXT:
|
||||
case NODE_TYPE.COMMENT:
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles pre-visit behaviour for the specified element node
|
||||
*
|
||||
* @param {DOMElement} node
|
||||
*/
|
||||
_beginVisitElement: function(node) {
|
||||
var tagName = node.tagName.toLowerCase();
|
||||
var attributes = [];
|
||||
for (var i = 0, count = node.attributes.length; i < count; i++) {
|
||||
attributes.push(this._getElementAttribute(node, node.attributes[i]));
|
||||
}
|
||||
|
||||
this.output += '<' + tagName;
|
||||
if (attributes.length > 0) {
|
||||
this.output += ' ' + attributes.join(' ');
|
||||
}
|
||||
if (node.firstChild) {
|
||||
this.output += '>';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles post-visit behaviour for the specified element node
|
||||
*
|
||||
* @param {Node} node
|
||||
*/
|
||||
_endVisitElement: function(node) {
|
||||
// De-indent a bit
|
||||
// TODO: It's inefficient to do it this way :/
|
||||
this.output = trimEnd(this.output, this.config.indent);
|
||||
if (node.firstChild) {
|
||||
this.output += '</' + node.tagName.toLowerCase() + '>';
|
||||
} else {
|
||||
this.output += ' />';
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles processing of the specified text node
|
||||
*
|
||||
* @param {TextNode} node
|
||||
*/
|
||||
_visitText: function(node) {
|
||||
var text = node.textContent;
|
||||
// If there's a newline in the text, adjust the indent level
|
||||
if (text.indexOf('\n') > -1) {
|
||||
text = node.textContent.replace(/\n\s*/g, this._getIndentedNewline());
|
||||
}
|
||||
this.output += text;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handles processing of the specified text node
|
||||
*
|
||||
* @param {Text} node
|
||||
*/
|
||||
_visitComment: function(node) {
|
||||
// Do not render the comment
|
||||
// Since we remove comments, we also need to remove the next line break so we
|
||||
// don't end up with extra whitespace after every comment
|
||||
//if (node.nextSibling && node.nextSibling.nodeType === NODE_TYPE.TEXT) {
|
||||
// node.nextSibling.textContent = node.nextSibling.textContent.replace(/\n\s*/, '');
|
||||
//}
|
||||
this.output += '{/*' + node.textContent.replace('*/', '* /') + '*/}';
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a JSX formatted version of the specified attribute from the node
|
||||
*
|
||||
* @param {DOMElement} node
|
||||
* @param {object} attribute
|
||||
* @return {string}
|
||||
*/
|
||||
_getElementAttribute: function(node, attribute) {
|
||||
switch (attribute.name) {
|
||||
case 'style':
|
||||
return this._getStyleAttribute(attribute.value);
|
||||
default:
|
||||
var name = ATTRIBUTE_MAPPING[attribute.name] || attribute.name;
|
||||
var result = name + '=';
|
||||
// Numeric values should be output as {123} not "123"
|
||||
if (isNumeric(attribute.value)) {
|
||||
result += '{' + attribute.value + '}';
|
||||
} else {
|
||||
result += '"' + attribute.value.replace('"', '"') + '"';
|
||||
}
|
||||
return result;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets a JSX formatted version of the specified element styles
|
||||
*
|
||||
* @param {string} styles
|
||||
* @return {string}
|
||||
*/
|
||||
_getStyleAttribute: function(styles) {
|
||||
var jsxStyles = new StyleParser(styles).toJSXString();
|
||||
return 'style={{' + jsxStyles + '}}';
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles parsing of inline styles
|
||||
*
|
||||
* @param {string} rawStyle Raw style attribute
|
||||
* @constructor
|
||||
*/
|
||||
var StyleParser = function(rawStyle) {
|
||||
this.parse(rawStyle);
|
||||
};
|
||||
StyleParser.prototype = {
|
||||
/**
|
||||
* Parse the specified inline style attribute value
|
||||
* @param {string} rawStyle Raw style attribute
|
||||
*/
|
||||
parse: function(rawStyle) {
|
||||
this.styles = {};
|
||||
rawStyle.split(';').forEach(function(style) {
|
||||
style = style.trim();
|
||||
var firstColon = style.indexOf(':');
|
||||
var key = style.substr(0, firstColon);
|
||||
var value = style.substr(firstColon + 1).trim();
|
||||
if (key !== '') {
|
||||
this.styles[key] = value;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert the style information represented by this parser into a JSX
|
||||
* string
|
||||
*
|
||||
* @return {string}
|
||||
*/
|
||||
toJSXString: function() {
|
||||
var output = [];
|
||||
for (var key in this.styles) {
|
||||
if (!this.styles.hasOwnProperty(key)) {
|
||||
continue;
|
||||
}
|
||||
output.push(this.toJSXKey(key) + ': ' + this.toJSXValue(this.styles[key]));
|
||||
}
|
||||
return output.join(', ');
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert the CSS style key to a JSX style key
|
||||
*
|
||||
* @param {string} key CSS style key
|
||||
* @return {string} JSX style key
|
||||
*/
|
||||
toJSXKey: function(key) {
|
||||
return hyphenToCamelCase(key);
|
||||
},
|
||||
|
||||
/**
|
||||
* Convert the CSS style value to a JSX style value
|
||||
*
|
||||
* @param {string} value CSS style value
|
||||
* @return {string} JSX style value
|
||||
*/
|
||||
toJSXValue: function(value) {
|
||||
if (isNumeric(value)) {
|
||||
// If numeric, no quotes
|
||||
return value;
|
||||
} else if (endsWith(value, 'px')) {
|
||||
// "500px" -> 500
|
||||
return trimEnd(value, 'px');
|
||||
} else {
|
||||
// Proably a string, wrap it in quotes
|
||||
return '\'' + value.replace(/'/g, '"') + '\'';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Expose public API
|
||||
global.HTMLtoJSX = HTMLtoJSX;
|
||||
}(window));
|
||||
// Ideally it would be nice to just redirect, but Github Pages is very basic and
|
||||
// lacks that functionality.
|
||||
console.warn(
|
||||
'html-jsx-lib.js has moved to http://reactjs.github.io/react-magic/' +
|
||||
'htmltojsx.min.js. If using React-Magic, you are no longer required to ' +
|
||||
'link to this file. Please delete its <script> tag.'
|
||||
);
|
||||
|
||||
@@ -79,6 +79,8 @@ var HELLO_COMPONENT = "\
|
||||
codeText={HELLO_COMPONENT}
|
||||
renderCode={true}
|
||||
transformer={this.convertToJSX}
|
||||
showCompiledJSTab={false}
|
||||
editorTabTitle="Live HTML Editor"
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -79,6 +79,8 @@ var ReactPlayground = React.createClass({
|
||||
codeText: React.PropTypes.string.isRequired,
|
||||
transformer: React.PropTypes.func,
|
||||
renderCode: React.PropTypes.bool,
|
||||
showCompiledJSTab: React.PropTypes.bool,
|
||||
editorTabTitle: React.PropTypes.string
|
||||
},
|
||||
|
||||
getDefaultProps: function() {
|
||||
@@ -86,6 +88,7 @@ var ReactPlayground = React.createClass({
|
||||
transformer: function(code) {
|
||||
return JSXTransformer.transform(code).code;
|
||||
},
|
||||
editorTabTitle: 'Live JSX Editor',
|
||||
showCompiledJSTab: true
|
||||
};
|
||||
},
|
||||
@@ -150,7 +153,7 @@ var ReactPlayground = React.createClass({
|
||||
<div
|
||||
className={JSXTabClassName}
|
||||
onClick={this.handleCodeModeSwitch.bind(this, this.MODES.JSX)}>
|
||||
Live JSX Editor
|
||||
{this.props.editorTabTitle}
|
||||
</div>
|
||||
|
||||
return (
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>React | {{ page.title }}</title>
|
||||
<title>{{ page.title }} | React</title>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta property="og:title" content="React | {{ page.title }}">
|
||||
<meta property="og:title" content="{{ page.title }} | React">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="http://facebook.github.io/react{{ page.url }}">
|
||||
<meta property="og:image" content="http://facebook.github.io/react/img/logo_og.png">
|
||||
@@ -42,7 +42,7 @@
|
||||
<div class="nav-main">
|
||||
<div class="wrap">
|
||||
<a class="nav-home" href="/react/index.html">
|
||||
<img class="nav-logo" alt="" src="/react/img/logo_small.png" width="38" height="38">
|
||||
<img class="nav-logo" src="/react/img/logo.svg" width="36" height="36">
|
||||
React
|
||||
</a>
|
||||
<ul class="nav-site">
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; {{ page.destination }}">
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
14
docs/_plugins/sidebar_item.rb
Normal file
14
docs/_plugins/sidebar_item.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
module Jekyll
|
||||
module SidebarItemFilter
|
||||
def sidebar_item_link(item)
|
||||
pageID = @context.registers[:page]["id"]
|
||||
itemID = item["id"]
|
||||
href = item["href"] || "/react/docs/#{itemID}.html"
|
||||
className = pageID == itemID ? ' class="active"' : ''
|
||||
|
||||
return "<a href=\"#{href}\"#{className}>#{item["title"]}</a>"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Liquid::Template.register_filter(Jekyll::SidebarItemFilter)
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: JSFiddle Integration
|
||||
layout: post
|
||||
author: Christopher Chedeau
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: Why did we build React?
|
||||
layout: post
|
||||
author: Pete Hunt
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #1"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #2"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.3.3"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #3"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "New in React v0.4: Autobind by Default"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #4"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "New in React v0.4: Prop Validation and Default Values"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.4.0"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #5"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.4.1"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Use React and JSX in Ruby on Rails"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Use React and JSX in Python Applications"
|
||||
layout: post
|
||||
author: Kunal Mehta
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #7"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #8"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.5"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.5.1"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #9"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
---
|
||||
title: "Thinking in React"
|
||||
layout: post
|
||||
author: Pete Hunt
|
||||
---
|
||||
|
||||
React is, in my opinion, the premier way to build big, fast Web apps with JavaScript. It's scaled very well for us at Facebook and Instagram.
|
||||
React is, in my opinion, the premier way to build big, fast Web apps with JavaScript. It has scaled very well for us at Facebook and Instagram.
|
||||
|
||||
One of the many great parts of React is how it makes you think about apps as you build them. In this post I'll walk you through the thought process of building a searchable product data table using React.
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "Community Round-up #10"
|
||||
layout: post
|
||||
author: Vjeux
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
<img src="/react/img/blog/steve_reverse.gif" style="float: right;" />
|
||||
<div style="width: 320px;"><blockquote class="twitter-tweet"><p>I think this reversed gif of Steve Urkel best describes my changing emotions towards the React Lib <a href="http://t.co/JoX0XqSXX3">http://t.co/JoX0XqSXX3</a></p>— Ryan Seddon (@ryanseddon) <a href="https://twitter.com/ryanseddon/statuses/398572848802852864">November 7, 2013</a></blockquote></div>
|
||||
<div style="width: 320px;"><blockquote class="twitter-tweet"><p>I think this reversed gif of Steve Urkel best describes my changing emotions towards the React Lib <a href="http://t.co/JoX0XqSXX3">http://t.co/JoX0XqSXX3</a></p>— Ryan Seddon (@ryanseddon) <a href="https://twitter.com/ryanseddon/statuses/398572848802852864">November 7, 2013</a></blockquote></div>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.5.2, v0.4.2"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
---
|
||||
title: "React v0.8"
|
||||
layout: post
|
||||
author: Paul O'Shannessy
|
||||
---
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user