first commit

This commit is contained in:
Missdrop
2025-07-16 16:30:56 +00:00
commit 7ee33927cb
11326 changed files with 1230901 additions and 0 deletions

68
node_modules/nib/lib/nib.js generated vendored Normal file
View File

@@ -0,0 +1,68 @@
/*!
* nib
* Copyright (c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var stylus = require('stylus'),
path = require('path'),
nodes = stylus.nodes,
utils = stylus.utils,
Canvas;
exports = module.exports = plugin;
// conditionally expose canvas-based APIs.
try {
Canvas = require('canvas');
var gradient = require('./nodes/gradient'),
colorImage = require('./nodes/color-image');
} catch (err) {
// ignore
}
/**
* Library version.
*/
exports.version = require(path.join(__dirname, '../package.json')).version;
/**
* Stylus path.
*/
exports.path = __dirname;
/**
* Return the plugin callback for stylus.
*
* @return {Function}
* @api public
*/
function plugin() {
return function(style){
style.include(__dirname);
if (Canvas) {
style.define('has-canvas', nodes.true);
// gradients
style.define('create-gradient-image', gradient.create);
style.define('gradient-data-uri', gradient.dataURL);
style.define('add-color-stop', gradient.addColorStop);
// color images
style.define('create-color-image', colorImage.create);
style.define('color-data-uri', colorImage.dataURL);
} else {
style.define('has-canvas', nodes.false);
}
};
}

53
node_modules/nib/lib/nib/border-radius.styl generated vendored Normal file
View File

@@ -0,0 +1,53 @@
/*
* Helper for border-radius().
*/
-apply-border-radius(pos, importance)
if length(pos) == 3
// border-radius: <top | bottom> <left | right> <n>
y = pos[0]
x = pos[1]
// We don't use vendor for boder-radius anymore
// vendor('border-radius-%s%s' % pos, pos[2], only: webkit official)
{'border-%s-%s-radius' % pos}: pos[2] importance
else if pos[0] in (top bottom)
// border-radius: <top | bottom> <n>
-apply-border-radius(pos[0] left pos[1], importance)
-apply-border-radius(pos[0] right pos[1], importance)
else if pos[0] in (left right)
// border-radius: <left | right> <n>
unshift(pos, top);
-apply-border-radius(pos, importance)
pos[0] = bottom
-apply-border-radius(pos, importance)
/*
* border-radius supporting augmented behavior.
*
* Examples:
*
* border-radius: 2px 5px
* border-radius: top 5px bottom 10px
* border-radius: left 5px
* border-radius: top left 5px
* border-radius: top left 10px bottom right 5px
* border-radius: top left 10px, bottom right 5px
*
*/
border-radius()
pos = ()
augmented = false
importance = arguments[length(arguments) - 1] == !important ? !important : unquote('')
for args in arguments
for arg in args
if arg is a 'ident'
append(pos, arg)
augmented = true
else
append(pos, arg)
if augmented
-apply-border-radius(pos, importance)
pos = ()
border-radius pos unless augmented

10
node_modules/nib/lib/nib/border.styl generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/*
* border: <color>
* border: ...
*/
border(color, args...)
if color is a 'color'
border: 1px solid color args
else
border: arguments

28
node_modules/nib/lib/nib/clearfix.styl generated vendored Normal file
View File

@@ -0,0 +1,28 @@
/*
* The Magnificent Micro Clearfix
*
* Useful for clearing floats without structural markup.
* Prevents margin-collapsing on child elements in most cases.
*
* Known issues:
*
* 1. For IE 6/7 when applied to an element that contains only left-floated
* children the bottom margin on child elements will be collapsed.
*
* 2. For Firefox versions prior to 3.5 when applied to the first child element
* of body, and the element does not have non-zero padding, extra space will
* appear between the body and the first child.
*
* See http://nicolasgallagher.com/micro-clearfix-hack/
* and http://j.mp/bestclearfix
*
*/
clearfix()
&:before
&:after
content: ""
display: table
&:after
clear: both
zoom: 1 if support-for-ie

4
node_modules/nib/lib/nib/color-image.styl generated vendored Normal file
View File

@@ -0,0 +1,4 @@
color-image(color)
error('node-canvas is required for color-image()') unless has-canvas
colorImage = create-color-image(color)
'url(%s)' % color-data-uri(colorImage)

11
node_modules/nib/lib/nib/config.styl generated vendored Normal file
View File

@@ -0,0 +1,11 @@
/*
* Support for ie defaulting to true.
*/
support-for-ie ?= true
/*
* Default vendor prefixes.
*/
vendor-prefixes ?= webkit moz o ms official

196
node_modules/nib/lib/nib/flex.styl generated vendored Normal file
View File

@@ -0,0 +1,196 @@
/*
* Vendor "display: flex" support with fallback to obsolete versions.
*/
flex-version ?= box flex
//
// 1. Display values
// - http://www.w3.org/TR/css3-flexbox/#flex-containers
//
display(type, args...)
if flex == type || inline-flex == type
if box in flex-version
if flex == type
display: -ms-flexbox args
display: vendor-value(box args, only: moz webkit)
else
display: -ms-inline-flexbox args
display: vendor-value(inline-box args, only: moz webkit)
if flex in flex-version
display: vendor-value(arguments, only: webkit official) // overwrites old webkit
else
display: arguments
/*
* New syntax for browsers like Google Chrome.
* Plus a translation to the old syntax, if possible.
*/
//
// 5. Ordering and Orientation
// - http://www.w3.org/TR/css3-flexbox/#ordering-and-orientation
//
-flex-obsolete-direction(direction)
if box in flex-version
if row-reverse == direction || column-reverse == direction
vendor('box-direction', reverse, ignore: ms official)
if row == direction || row-reverse == direction
vendor('box-orient', horizontal, ignore: ms official)
else if column == direction || column-reverse == direction
vendor('box-orient', vertical, ignore: ms official)
-flex-obsolete-wrap(value)
if box in flex-version
// WARN: wrap-reverse does not have a box equivalent. This will render in different manners
// on box vs. flex values.
if 'wrap' == value || wrap-reverse == value
vendor('box-lines', multiple, ignore: ms official)
else if nowrap == value
vendor('box-lines', single, ignore: ms official)
flex-direction(direction)
// obsolete
-flex-obsolete-direction(direction)
// new
if flex in flex-version
vendor('flex-direction', arguments, only: webkit ms official)
flex-wrap(value)
// obsolete
-flex-obsolete-wrap(value)
if flex in flex-version
vendor('flex-wrap', arguments, only: webkit ms official)
flex-flow()
// obsolete
-flex-obsolete-direction(arguments[0])
-flex-obsolete-direction(arguments[1])
-flex-obsolete-wrap(arguments[0])
-flex-obsolete-wrap(arguments[1])
// new
if flex in flex-version
vendor('flex-flow', arguments, only: webkit ms official)
order()
// obsolete
if box in flex-version
vendor('box-ordinal-group', arguments, ignore: ms official)
// new
if flex in flex-version
vendor('flex-order', arguments, only: ms)
vendor('order', arguments, only: webkit official)
//
// 7. Flexibility
// - http://www.w3.org/TR/css3-flexbox/#flexibility
//
flex-grow(growth)
// obsolete
if box in flex-version
vendor('box-flex', growth)
// new
if flex in flex-version
vendor('flex-grow', arguments, only: webkit official)
flex-basis()
if flex in flex-version
vendor('flex-basis', arguments, only: webkit official)
flex-shrink()
if flex in flex-version
vendor('flex-shrink', arguments, only: webkit official)
flex(growth)
// obsolete
if box in flex-version
shrink = 1
if none == growth || initial == growth
// Well known values
shrink = 0 if none == growth
growth = 0
else if is-width(growth) == true
// Basis is defined as the first parameter
growth = arguments[1] || 0
shrink = arguments[2] if 3 <= length(arguments)
else if arguments[1] && is-width(arguments[1]) == false
// Growth is first and shrink is second
shrink = arguments[1]
// Since we can't make the distinction between growing and shrinking in the box model, take
// the one that provides the most flexibility.
vendor('box-flex', max(growth, shrink), ignore: ms)
// new
if flex in flex-version
vendor('flex', arguments, only: webkit ms official)
// converts the justification alignment
-convert-justify(align)
if flex-start == align
return start
else if flex-end == align
return end
else if space-around == align
return distribute
else if space-between == align
return justify
else
return align
//
// 8. Alignment
// - http://www.w3.org/TR/css3-flexbox/#alignment
//
justify-content(align)
// obsolete
if box in flex-version
vendor('box-pack', -convert-justify(align), ignore: ms official)
// new
if flex in flex-version
vendor('flex-pack', -convert-justify(align), only: ms)
vendor('justify-content', align, only: webkit official)
align-content(align)
// WARN: Obsolete spec does not allow for adjustment here
if flex in flex-version
vendor('flex-line-pack', -convert-justify(align), only: ms)
vendor('align-content', align, only: webkit official)
// converts alignment from 'flex' to normal value
-convert-alignment(align)
if flex-start == align
return start
else if flex-end == align
return end
else
return align
align-items(align)
// obsolete
if box in flex-version
vendor('box-align', -convert-alignment(align), ignore: ms official)
// new
if flex in flex-version
vendor('flex-align', -convert-alignment(align), only: ms)
vendor('align-items', arguments, only: webkit official)
align-self(align)
// WARN: Obsolete spec does not allow for overriding alignment on individual items.
if flex in flex-version
vendor('align-self', align, only: webkit official)
vendor('flex-item-align', -convert-alignment(align), only: ms)

90
node_modules/nib/lib/nib/gradients.styl generated vendored Normal file
View File

@@ -0,0 +1,90 @@
@import 'config'
/*
* Implicit color stop position.
*/
pos-in-stops(i, stops)
len = length(stops)
if len - 1 == i
100%
else if i
unit(i / len * 100, '%')
else
0
/*
* Normalize color stops:
*
* - (color pos) -> (pos color)
* - (color) -> (implied-pos color)
*
*/
normalize-stops(stops)
stops = clone(stops)
for stop, i in stops
if length(stop) == 1
color = stop[0]
stop[0] = pos-in-stops(i, stops)
stop[1] = color
else if typeof(stop[1]) == 'unit'
pos = stop[1]
stop[1] = stop[0]
stop[0] = pos
stops
/*
* Join color stops with the given translation function.
*/
join-stops(stops, translate)
str = ''
len = length(stops)
for stop, i in stops
str += ', ' if i
pos = stop[0]
color = stop[1]
str += translate(color, pos)
unquote(str)
/*
* Standard color stop.
*/
std-stop(color, pos)
'%s %s' % (color pos)
/*
* Create a linear gradient with the given start position
* and variable number of color stops.
*
* Examples:
*
* background: linear-gradient(top, red, green, blue)
* background: linear-gradient(bottom, red, green 50%, blue)
* background: linear-gradient(bottom, red, 50% green, blue)
* background: linear-gradient(bottom, red, 50% green, 90% white, blue)
*
*/
linear-gradient(start, stops...)
error('color stops required') unless length(stops)
unquote('linear-gradient(' + join(', ',arguments) + ')')
/*
* Create a linear gradient image with the given start position
* and variable number of color stops.
*/
linear-gradient-image(start, stops...)
error('node-canvas is required for linear-gradient-image()') unless has-canvas
stops = stops[0] if length(stops) == 1
error('gradient image size required') unless start[0] is a 'unit'
size = start[0]
start = start[1] or 'top'
grad = create-gradient-image(size, start)
stops = normalize-stops(stops)
add-color-stop(grad, stop[0], stop[1]) for stop in stops
'url(%s)' % gradient-data-uri(grad)

7
node_modules/nib/lib/nib/iconic.styl generated vendored Normal file
View File

@@ -0,0 +1,7 @@
iconic-stroke(path)
@font-face
font-family: 'IconicStroke'
src: url(path + '/iconic_stroke.eot')
src: local(''), url(path + '/iconic_stroke.ttf') format('truetype'), url(path + '/iconic_stroke.svg#iconic') format('svg')
font-weight: normal
font-style: normal

25
node_modules/nib/lib/nib/image.styl generated vendored Normal file
View File

@@ -0,0 +1,25 @@
/*
* Define background-image as `path` with optional width and height, adding an
* @2x variant.
*
* affected by github.com/LearnBoost/stylus/issues/1050 and
* github.com/LearnBoost/stylus/issues/1038 ... refactor when those are closed
*/
image(path, w = auto, h = auto, min_pixel_ratio = 1.5)
background-image: url(path)
s = 'all and (-webkit-min-device-pixel-ratio:' + min_pixel_ratio + '),'
s = s + '(min--moz-device-pixel-ratio:' + min_pixel_ratio + '),'
s = s + '(-o-min-device-pixel-ratio:' + min_pixel_ratio + '/1),'
s = s + '(min-device-pixel-ratio:' + min_pixel_ratio + '),'
s = s + '(min-resolution:' + unit(min_pixel_ratio*92, dpi) + '),'
s = s + '(min-resolution:' + unit(min_pixel_ratio, dppx) + ')'
@media s
ext = extname(path)
path = pathjoin(dirname(path), basename(path, ext) + '@2x' + ext)
background-image: url(path)
if w in (cover contain) and h == auto
h = null
background-size: w h

15
node_modules/nib/lib/nib/index.styl generated vendored Normal file
View File

@@ -0,0 +1,15 @@
@import 'border'
@import 'border-radius'
@import 'clearfix'
@import 'color-image'
@import 'flex'
@import 'gradients'
@import 'iconic'
@import 'image'
@import 'normalize'
@import 'overflow'
@import 'positions'
@import 'reset'
@import 'text'
@import 'vendor'
@import 'size'

8
node_modules/nib/lib/nib/normalize/base.styl generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-base()
html // Prevent iOS text size adjust after orientation change.
font-family sans-serif
-ms-text-size-adjust 100%
-webkit-text-size-adjust 100%
body
margin 0

7
node_modules/nib/lib/nib/normalize/embed.styl generated vendored Normal file
View File

@@ -0,0 +1,7 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-embed()
img // No border when inside `a` in IE 8~10.
border 0
svg:not(:root) // Overflow should be hidden in IE 9~11.
overflow hidden

69
node_modules/nib/lib/nib/normalize/forms.styl generated vendored Normal file
View File

@@ -0,0 +1,69 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-forms()
// Known limitation: Chrome and Safari on OS X allow very limited
// styling of `select`, unless a `border` property is set.
button, input, optgroup, select, textarea
color inherit // Correct color not being inherited.
font inherit // Correct font properties not being inherited.
margin 0 // Fix margins in FF 4+, Safari, and Chrome.
button // Fix `overflow` set to `hidden` in IE 8/9/10/11.
overflow visible
button, select // Consistent text-transform across browsers.
text-transform none
// Fix WebKit bug in Android 4.0, inability to style clickable `input` in
// iOS and improve usability and consistency of cursor style.
button, html input[type='button'], input[type='reset'], input[type='submit']
cursor pointer
-webkit-appearance button
// Reset default cursor for disabled elements.
button[disabled], html input[disabled]
cursor default
// Remove inner padding and border in FF 4+.
button::-moz-focus-inner, input::-moz-focus-inner
border 0
padding 0
input // Reset line-height again FF 4+ UA stylsheet.
line-height normal
// Fix box sizing and excess padding in IE 8~10
input[type='checkbox'], input[type='radio']
box-sizing border-box
padding 0
// Fix the cursor style for Chrome's increment/decrement buttons.
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button
height auto
// Consistent appearance and box-sizing in Safari and Chrome.
input[type='search']
-webkit-appearance textfield
-moz-box-sizing content-box
-webkit-box-sizing content-box
box-sizing content-box
// No inner padding and search cancel button in Safari and Chrome on OS X.
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration
-webkit-appearance none
fieldset // Consistent border, margin, and padding.
border 1px solid #c0c0c0
margin 0 2px
padding 0.35em 0.625em 0.75em
legend // Hack to correct `color` not being inherited in IE 8/9/10/11.
border 0
padding 0
textarea // Remove default vertical scrollbar in IE 8~11.
overflow auto
optgroup // Don't inherit the `font-weight` applied above.
font-weight bold

17
node_modules/nib/lib/nib/normalize/groups.styl generated vendored Normal file
View File

@@ -0,0 +1,17 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-groups()
figure // Margin should exist in IE 8~9 / Safari.
margin 1em 40px
hr // Consistency between FF and others.
-moz-box-sizing content-box
box-sizing content-box
height 0
pre // Contain overflow and wrap words.
overflow auto
// Hack to fix odd `em`-unit font size rendering in all browsers.
code, kbd, pre, samp
font-family monospace, monospace
font-size 1em

19
node_modules/nib/lib/nib/normalize/html5.styl generated vendored Normal file
View File

@@ -0,0 +1,19 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-html5()
// `block` display for HTML5 elements in IE 8~11 and FF.
article, details, section, summary,
aside, main, menu, nav, figcaption,
figure, footer, header, hgroup
display block
audio, canvas, progress, video
display inline-block // Set `inline-block` not defined in IE 8~9.
vertical-align baseline // Fix v-align of `progress` in Chrome, FF, and O.
audio:not([controls])
display none // Prevent displaying `audio` without controls.
height 0 // Remove excess height in iOS 5 devices.
[hidden], // Address `[hidden]` styling not present in IE 8~10.
template // Hide the `template` element in IE 8~11, Safari, and FF < 22.
display none

19
node_modules/nib/lib/nib/normalize/index.styl generated vendored Normal file
View File

@@ -0,0 +1,19 @@
// Based in Nicolas Gallagher's git.io/normalize
@import './base'
@import './html5'
@import './links'
@import './text'
@import './embed'
@import './groups'
@import './forms'
@import './tables'
normalize-css()
normalize-base()
normalize-html5()
normalize-links()
normalize-text()
normalize-embed()
normalize-groups()
normalize-forms()
normalize-tables()

6
node_modules/nib/lib/nib/normalize/links.styl generated vendored Normal file
View File

@@ -0,0 +1,6 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-links()
a // No gray bg color in active links in IE 10.
background-color transparent
&:active, &:hover
outline 0 // + readability when focused.

7
node_modules/nib/lib/nib/normalize/tables.styl generated vendored Normal file
View File

@@ -0,0 +1,7 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-tables()
table // Remove most spacing between table cells.
border-collapse collapse
border-spacing 0
td, th
padding 0

30
node_modules/nib/lib/nib/normalize/text.styl generated vendored Normal file
View File

@@ -0,0 +1,30 @@
// Based in Nicolas Gallagher's git.io/normalize
normalize-text()
abbr[title] // + style not present in IE 8~11, Safari, and Chrome.
border-bottom 1px dotted
dfn // + style not present in Safari and Chrome.
font-style italic
mark // + style not present in IE 8/9.
background #ff0; color #000
b, strong // Fix `font-weight: bolder` in FF 4+, Safari, and Chrome.
font-weight bold
h1 // `h1` inside `section` and `article` fix for FF 4+, Safari & Chrome.
font-size 2em
margin 0.67em 0
small // Consistent font-size across browsers.
font-size 80%
sub, sup // Prevent `sub` and `sup` affecting `line-height`.
font-size 75%
line-height 0
position relative
vertical-align baseline
sup
top -0.5em
sub
bottom -0.25em

20
node_modules/nib/lib/nib/overflow.styl generated vendored Normal file
View File

@@ -0,0 +1,20 @@
/*
* Overflow utility. Maps to regular overflow, and adds an ellipsis value.
*
* Synopsis:
*
* overflow: <type>
*
* Examples:
*
* overflow: auto
* overflow: hidden
* overflow: ellipsis
*
*/
overflow()
if arguments[0] == ellipsis
ellipsis()
else
overflow: arguments

66
node_modules/nib/lib/nib/positions.styl generated vendored Normal file
View File

@@ -0,0 +1,66 @@
// helper
-pos(type, args)
i = 0
position: unquote(type)
for j in (1..4)
if length(args) > i
{args[i]}: args[i + 1] is a 'unit' ? args[i += 1] : 0
i += 1
/*
* Position utility.
*
* Synopsis:
*
* fixed: <pos> [n] <pos> [n]
*
* Examples:
*
* fixed: top left
* fixed: top 5px left
* fixed: top left 5px
* fixed: top 5px left 5px
*
*/
fixed()
-pos('fixed', arguments)
/*
* Position utility.
*
* Synopsis:
*
* absolute: <pos> [n] <pos> [n]
*
* Examples:
*
* absolute: top left
* absolute: top 5px left
* absolute: top left 5px
* absolute: top 5px left 5px
*
*/
absolute()
-pos('absolute', arguments)
/*
* Position utility.
*
* Synopsis:
*
* relative: <pos> [n] <pos> [n]
*
* Examples:
*
* relative: top left
* relative: top 5px left
* relative: top left 5px
* relative: top 5px left 5px
*
*/
relative()
-pos('relative', arguments)

78
node_modules/nib/lib/nib/reset.styl generated vendored Normal file
View File

@@ -0,0 +1,78 @@
// Based on [Eric Meyer's reset](http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/)
global-reset()
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td
reset-box-model()
reset-font()
body
reset-body()
ol, ul
list-style: none
table
reset-table()
caption, th, td
reset-table-cell()
a img
border: none
nested-reset()
div, span, object, iframe, h1, h2, h3, h4, h5, h6, p,
pre, a, abbr, acronym, address, code, del, dfn, em, img,
dl, dt, dd, ol, ul, li, fieldset, form, label,
legend, caption, tbody, tfoot, thead, tr
reset-box-model()
reset-font()
table
reset-table()
caption, th, td
reset-table-cell()
a img
border: none
reset-box-model()
margin: 0
padding: 0
border: 0
outline: 0
reset-font()
font-weight: inherit
font-style: inherit
font-family: inherit
font-size: 100%
vertical-align: baseline
reset-body()
line-height: 1
color: black
background: white
reset-table()
border-collapse: separate
border-spacing: 0
vertical-align: middle
reset-table-cell()
text-align: left
font-weight: normal
vertical-align: middle
reset-html5()
article, aside, canvas, details, figcaption,
figure, footer, header, hgroup, menu, nav,
section, summary, main
reset-box-model()
display: block
audio, canvas, video
display inline-block
*display inline
*zoom 1
audio:not([controls]),[hidden]
display none

28
node_modules/nib/lib/nib/size.styl generated vendored Normal file
View File

@@ -0,0 +1,28 @@
/*
* Size utility.
*
* Synopsis:
*
* size: <width> <height> | <width & height>
*
* Examples:
*
* size: 100% 30px
* yields:
* width: 100%
* height: 30px
*
* size: 5px
* yields:
* width: 5px
* height: 5px
*
*/
size()
if length(arguments) == 1
width: arguments[0]
height: arguments[0]
else
width: arguments[0]
height: arguments[1]

12
node_modules/nib/lib/nib/text/aliases.styl generated vendored Normal file
View File

@@ -0,0 +1,12 @@
/*
* Alias of "nowrap".
*/
no-wrap = unquote('nowrap')
/*
* Alias of "white-space".
*/
whitespace()
white-space: arguments

9
node_modules/nib/lib/nib/text/ellipsis.styl generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/*
* Ellipsis with wrapping disabled by default.
*/
ellipsis(no-wrap = true)
if no-wrap
white-space: nowrap
overflow: hidden
text-overflow: ellipsis

8
node_modules/nib/lib/nib/text/hide-text.styl generated vendored Normal file
View File

@@ -0,0 +1,8 @@
/*
* Hide text.
*/
hide-text()
text-indent: 101%
white-space: nowrap
overflow: hidden

5
node_modules/nib/lib/nib/text/index.styl generated vendored Normal file
View File

@@ -0,0 +1,5 @@
@import './aliases'
@import './ellipsis'
@import './hide-text'
@import './replace-text'
@import './shadow-stroke'

9
node_modules/nib/lib/nib/text/replace-text.styl generated vendored Normal file
View File

@@ -0,0 +1,9 @@
/*
* Replace text with an image.
*/
replace-text(image, x=50%, y=50%)
hide-text()
background-image image
background-repeat no-repeat
background-position x y

2
node_modules/nib/lib/nib/text/shadow-stroke.styl generated vendored Normal file
View File

@@ -0,0 +1,2 @@
shadow-stroke(n)
text-shadow: -1px -1px 0 n, 1px -1px 0 n, -1px 1px 0 n, 1px 1px 0 n

516
node_modules/nib/lib/nib/vendor.styl generated vendored Normal file
View File

@@ -0,0 +1,516 @@
use('../nodes/vendor-helpers.js')
@import 'config'
/*
* Alias "nowrap" as "no-wrap".
*/
no-wrap = unquote('nowrap')
/*
* Helper to find out if a given value is a width
*/
is-width(val)
if auto == val
return true
else if val && 'unit' == type(val)
// Stylus does not short circuit so we need to perform this as a distinct
// operation to prevent errors
return '' != unit(val)
return false
/*
* Vendor support for the given prop / arguments, optionally specifying the
* only prefixes to utilize, or those which should be ignored.
*/
vendor(prop, args, only = null, ignore = null, vendor-property = true)
need_normalize = !vendor-property or prop in ('transition' 'transition-property' 'border-image' 'border-image-slice')
for prefix in vendor-prefixes
unless (only and !(prefix in only)) or (ignore and prefix in ignore)
if official == prefix
if need_normalize
{prop}: normalize(prop,('%s' % args))
else
{prop}: args
else
newprop = prop
newprop = '-' + prefix + '-' + prop if vendor-property
if need_normalize
{newprop}: normalize(prop,('%s' % args),prefix)
else
{newprop}: args
/*
* Vendorize the given value.
*/
vendor-value(arg, only = null, ignore = null)
prop = current-property[0]
for prefix in vendor-prefixes
unless (only and !(prefix in only)) or (ignore and prefix in ignore) or official == prefix
add-property(prop, '-%s-%s' % (prefix arg))
arg
/*
* Vendor "box-shadow" support.
*/
box-shadow()
vendor('box-shadow', arguments, only: webkit official)
/*
* Vendor "user-select" support.
*/
user-select()
vendor('user-select', arguments, only: webkit moz ms official)
/*
* Vendor "column-count" support.
*/
column-count()
vendor('column-count', arguments, only: webkit moz official)
/*
* Vendor "column-gap" support.
*/
column-gap()
vendor('column-gap', arguments, only: webkit moz official)
/*
* Vendor "column-rule" support.
*/
column-rule()
vendor('column-rule', arguments, only: webkit moz official)
/*
* Vendor "column-rule-color" support.
*/
column-rule-color()
vendor('column-rule-color', arguments, only: webkit moz official)
/*
* Vendor "column-rule-width" support.
*/
column-rule-width()
vendor('column-rule-width', arguments, only: webkit moz official)
/*
* Vendor "column-rule-style" support.
*/
column-rule-style()
vendor('column-rule-style', arguments, only: webkit moz official)
/*
* Vendor "column-width" support.
*/
column-width()
vendor('column-width', arguments, only: webkit moz official)
/*
* Vendor "column-span" support.
*/
column-span()
vendor('column-span', arguments, only: webkit official)
/*
* Vendor "column-fill" support.
*/
column-fill()
vendor('column-fill', arguments, only: moz official)
/*
* Legacy syntax support for background-clip and background-origin
*/
legacy-bg-values(property, args)
legacy_args = ()
importance = unquote('')
for subargs in args
for arg in subargs
if arg in (border-box padding-box content-box)
arg = unquote('border') if arg == border-box
arg = unquote('padding') if arg == padding-box
arg = unquote('content') if arg == content-box
if arg != '!important'
push(legacy_args,arg)
else
importance = !important
vendor(property, unquote(join(', ',legacy_args)) importance, only: moz webkit)
/*
* Vendor "background-clip" support.
*/
background-clip()
if arguments[0] == text
vendor('background-clip', arguments, only: webkit)
else
legacy-bg-values('background-clip', arguments)
background-clip: arguments
/*
* Vendor "background-origin" support.
*/
background-origin()
legacy-bg-values('background-origin', arguments)
background-origin: arguments
/*
* Vendor "transform" support.
*/
transform()
vendor('transform', arguments)
/*
* Vendor "transform-origin" support.
*/
transform-origin()
vendor('transform-origin', arguments)
/*
* Vendor "transform-style" support.
*/
transform-style()
vendor('transform-style', arguments)
/*
* Vendor "border-image" support.
*/
border-image()
vendor('border-image', arguments, only: webkit moz o official)
/*
* Vendor "transition" support.
*/
transition()
vendor('transition', arguments)
/*
* Vendor "transition-property" support.
*/
transition-property()
vendor('transition-property', arguments)
/*
* Vendor "transition-duration" support.
*/
transition-duration()
vendor('transition-duration', arguments)
/*
* Vendor "transition-timing-function" support.
*/
transition-timing-function()
vendor('transition-timing-function', arguments)
/*
* Vendor "transition-delay" support.
*/
transition-delay()
vendor('transition-delay', arguments)
/*
* Vendor "backface-visibility" support.
*/
backface-visibility()
vendor('backface-visibility', arguments, only: webkit moz ms official)
/*
* Vendor "perspective" support.
*/
perspective()
if mixin
vendor('perspective', arguments, only: webkit moz ms official)
else
'perspective(%s)' % arguments
/*
* Vendor "perspective-origin" support.
*/
perspective-origin()
vendor('perspective-origin', arguments, only: webkit moz ms official)
/*
* Opacity with conditional IE support.
*/
opacity(n, args...)
opacity: n args
if support-for-ie
if n == inherit or n == initial
-ms-filter: n args
filter: n args
else
val = round(n * 100)
if val == 100
-ms-filter: none args
filter: none args
else
-ms-filter: '"progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)"' % val args
filter: 'alpha(opacity=%s)' % val args
/*
* Vendor "text-size-adjust"
*/
text-size-adjust()
vendor('text-size-adjust', arguments)
/*
* Alias the "white-space" property.
*/
whitespace()
white-space: arguments
/*
* Vendor "box-sizing" support.
*/
box-sizing()
vendor('box-sizing', arguments, only: webkit moz official)
/*
* Vendor "box-orient" support.
*/
box-orient()
vendor('box-orient', arguments, only: webkit moz official)
/*
* Vendor "box-flex-group" support.
*/
box-flex-group()
vendor('box-flex-group', arguments, only: webkit moz official)
/*
* Vendor "box-ordinal-group" support.
*/
box-ordinal-group()
vendor('box-ordinal-group', arguments, only: webkit moz ms official)
/*
* Vendor "box-align" support.
*/
box-align()
vendor('box-align', arguments, only: webkit moz ms official)
/*
* Vendor "box-pack" support.
*/
box-pack()
vendor('box-pack', arguments, only: webkit moz ms official)
/*
* Vendor "box-direction" support.
*/
box-direction()
vendor('box-direction', arguments, only: webkit moz ms official)
/*
* Vendor "animation" support.
*/
animation()
vendor('animation', arguments)
/*
* Vendor "animation-name" support.
*/
animation-name()
vendor('animation-name', arguments)
/*
* Vendor "animation-duration" support.
*/
animation-duration()
vendor('animation-duration', arguments)
/*
* Vendor "animation-delay" support.
*/
animation-delay()
vendor('animation-delay', arguments)
/*
* Vendor "animation-direction" support.
*/
animation-direction()
vendor('animation-direction', arguments)
/*
* Vendor "animation-iteration-count" support.
*/
animation-iteration-count()
vendor('animation-iteration-count', arguments)
/*
* Vendor "animation-timing-function" support.
*/
animation-timing-function()
vendor('animation-timing-function', arguments)
/*
* Vendor "animation-play-state" support.
*/
animation-play-state()
vendor('animation-play-state', arguments)
/*
* Vendor "animation-fill-mode" support.
*/
animation-fill-mode()
vendor('animation-fill-mode', arguments)
/*
* Vendor "hyphens" support.
*/
hyphens()
vendor('hyphens', arguments, only: webkit moz ms official)
/*
* Vendor "appearance" support.
*/
appearance()
vendor('appearance', arguments, only: webkit moz official)
/*
* Vendor "tab-size" support.
*/
tab-size()
vendor('tab-size', arguments, only: moz o official)
/*
* Vendor "overflow-scrolling" support.
*/
overflow-scrolling()
vendor('overflow-scrolling', arguments, only: webkit official)
/*
* Vendor "text-overflow" support, , -o- for opera 9.* - 10.*
*/
text-overflow()
vendor('text-overflow', arguments, only: official o)
/*
* Vendor "text-size-adjust" support.
*/
text-size-adjust()
vendor('text-size-adjust', arguments, only: official webkit ms)
/*
* Vendor "font-smoothing" support, webkit only.
*/
font-smoothing()
vendor('font-smoothing', arguments, only: webkit)
/**
* Vendor input-placeholder/placeholder support.
*
* Examples:
* // Default syntax
* body
* placeholder(color #333, font-weight normal)
*
* // The comma is important
* .placeholder-red
* placeholder(color red,)
*
* // We can pass a function
* green-placeholder()
* color green
* .placeholder-green
* placeholder(green-placeholder)
*
* // We can pass a hash
* textarea
* placeholder((font-style italic) (font-weight bold) (padding '4px 10px'))
*/
placeholder()
for v in ':-webkit-input' '-moz' ':-moz' '-ms-input'
&:{v}-placeholder
for pair in arguments
if typeof(pair) == 'function'
pair()
else if pair is not null && pair[0] is not null
{pair[0]}: type(pair[1]) == 'string' ? s(pair[1]) : pair[1]
input-placeholder = placeholder
/*
* Vendor background support (gradients).
*/
background()
if match('-gradient\(', ''+arguments)
vendor('background', arguments, vendor-property: false)
else
background arguments
background-image()
if match('-gradient\(', ''+arguments)
vendor('background-image', arguments, vendor-property: false)
else
background-image arguments
cursor()
if match('-gradient\(', ''+arguments)
vendor('cursor', arguments, vendor-property: false)
else
cursor arguments
list-style()
if match('-gradient\(', ''+arguments)
vendor('list-style', arguments, vendor-property: false)
else
list-style arguments
list-style-image()
if match('-gradient\(', ''+arguments)
vendor('list-style-image', arguments, vendor-property: false)
else
list-style-image arguments

83
node_modules/nib/lib/nodes/color-image.js generated vendored Normal file
View File

@@ -0,0 +1,83 @@
/**
* Module dependencies.
*/
var stylus = require('stylus'),
Canvas = require('canvas'),
nodes = stylus.nodes,
utils = stylus.utils;
/**
* Expose `ColorImage`.
*/
exports = module.exports = ColorImage;
/**
* Create a new `ColorImage` node with the given `color`.
*
* @param {Color} color node
* @return {ColorImage}
* @api public
*/
exports.create = function(color){
utils.assertColor(color);
return new ColorImage(color);
};
/**
* Return the data URI for `colorImage`.
*
* @param {ColorImage} colorImage
* @return {String}
* @api public
*/
exports.dataURL = function(colorImage){
utils.assertType(colorImage, 'colorimage');
return new nodes.String(colorImage.toDataURL());
};
/**
* Initialize a new `ColorImage` node with the given arguments.
*
* @param {Color} color node
* @api private
*/
function ColorImage(color) {
this.color = color;
this.canvas = new Canvas(1, 1);
this.ctx = this.canvas.getContext('2d');
this.ctx.fillStyle = color.toString();
this.ctx.fillRect(0, 0, 1, 1);
}
/**
* Inherit from `nodes.Node.prototype`.
*/
ColorImage.prototype.__proto__ = nodes.Node.prototype;
/**
* Inspect the color.
*
* @return {String}
* @api private
*/
ColorImage.prototype.toString = function(){
return 'ColorImage(' + this.color.toString() + ')';
};
/**
* Return data URI string.
*
* @return {String}
* @api private
*/
ColorImage.prototype.toDataURL = function(){
return this.canvas.toDataURL();
};

163
node_modules/nib/lib/nodes/gradient.js generated vendored Normal file
View File

@@ -0,0 +1,163 @@
/**
* Module dependencies.
*/
var stylus = require('stylus'),
Canvas = require('canvas'),
nodes = stylus.nodes,
utils = stylus.utils;
/**
* Expose `Gradient`.
*/
exports = module.exports = Gradient;
/**
* Create a new `Gradient` node with the given `size`
* and `start` position.
*
* @param {Number} size
* @param {String|Ident|Literal} start
* @return {Gradient}
* @api public
*/
exports.create = function(size, start){
utils.assertType(size, 'unit', 'size');
utils.assertString(start, 'start');
return new Gradient(size.val, start.string);
};
/**
* Add color stop to `grad`.
*
* @param {Gradient} grad
* @param {Unit} pos
* @param {HSLA|RGBA} color
* @return {Null}
* @api public
*/
exports.addColorStop = function(grad, pos, color){
utils.assertType(grad, 'gradient', 'grad');
utils.assertType(pos, 'unit', 'pos');
utils.assertColor(color, 'color');
grad.addColorStop(pos.val / 100, color.rgba.toString());
return nodes.null;
};
/**
* Return the data URI for `grad`.
*
* @param {Gradient} grad
* @return {String}
* @api public
*/
exports.dataURL = function(grad){
utils.assertType(grad, 'gradient');
return new nodes.String(grad.toDataURL());
};
/**
* Initialize a new `Gradient` node with the given `size`
* and `start` position.
*
* @param {Number} size
* @param {String} start
* @api private
*/
function Gradient(size, start) {
this.size = size;
this.canvas = new Canvas(1, 1);
this.setStartPosition(start);
this.ctx = this.canvas.getContext('2d');
this.grad = this.ctx.createLinearGradient(
this.from[0], this.from[1],
this.to[0], this.to[1]);
}
/**
* Inspect the gradient.
*
* @return {String}
* @api private
*/
Gradient.prototype.toString = function(){
return 'Gradient(' + this.size + 'px ' + this.stops.map(function(stop){
return stop[0] + ' ' + stop[1];
}).join(', ') + ')';
};
/**
* Set `start` position.
*
* @param {String} start
* @api private
*/
Gradient.prototype.setStartPosition = function(start){
var size = this.size,
canvas = this.canvas;
switch (start) {
case 'top':
canvas.height = size;
this.from = [canvas.width / 2, 0];
this.to = [canvas.width / 2, canvas.height];
break;
case 'bottom':
canvas.height = size;
this.from = [canvas.width / 2, canvas.height];
this.to = [canvas.width / 2, 0];
break;
case 'left':
canvas.width = size;
this.from = [0, 0];
this.to = [canvas.width, canvas.height];
break;
case 'right':
canvas.width = size;
this.from = [canvas.width, canvas.height];
this.to = [0, 0];
break;
default:
throw new Error('invalid start position "' + start + '"');
}
};
/**
* Add color stop `pos` / `color`.
*
* @param {Number} pos
* @param {String} color
* @api private
*/
Gradient.prototype.addColorStop = function(pos, color){
this.grad.addColorStop(pos, color);
};
/**
* Return data URI string.
*
* @return {String}
* @api private
*/
Gradient.prototype.toDataURL = function(){
var canvas = this.canvas,
ctx = this.ctx;
ctx.fillStyle = this.grad;
ctx.fillRect(0, 0, canvas.width, canvas.height);
return canvas.toDataURL();
};
/**
* Inherit from `nodes.Node.prototype`.
*/
Gradient.prototype.__proto__ = nodes.Node.prototype;

79
node_modules/nib/lib/nodes/vendor-helpers.js generated vendored Normal file
View File

@@ -0,0 +1,79 @@
var RE_GRADIENT_STOPS = /([\(\,]\s*)(-?(?:\d*\.)?\d+(?:%|px|em))(\s+)((hsl|rgb)a?\([^\)]+\)|#[^\)\,]+)/g,
RE_GRADIENT_VAL = /(\(\s*)(?:(-?(\d*\.)?\d+)deg|((to )?(top|bottom|left|right)( (top|bottom|left|right))?))/g,
RE_GRADIENT_TYPE = /((repeating-)?(linear|radial)-gradient\()/g,
RE_TRANSFORM = /\b(transform)\b/g,
RE_FILL_KEYWORD = /\s*\b(fill)\b\s*/g;
var DIRECTIONS = { top: 'bottom', bottom: 'top', left: 'right', right:'left' };
/**
* Expose `normalize`.
*/
function normalize(property, value, prefix){
var result = value.toString(),
args;
/* Fixing the gradients */
if (~result.indexOf('gradient(')) {
/* Normalize color stops */
result = result.replace(RE_GRADIENT_STOPS,'$1$4$3$2');
/* Normalize legacy gradients */
result = result.replace(RE_GRADIENT_VAL, function(){
args = [].slice.call(arguments, 1);
return normalizeGradient(args, prefix);
});
/* Adding prefixes to the legacy gradients */
if (prefix) result = result.replace(RE_GRADIENT_TYPE, '-' + prefix + '-$1');
}
/* Adding prefixes to the `transform` values of legacy `transition` property */
if (prefix && (property == "'transition'" || property == "'transition-property'")) {
result = result.replace(RE_TRANSFORM, '-' + prefix + '-$1');
}
/* Removing `fill` keyword from the legacy `border-image` property */
if (prefix && (property == "'border-image'" || property == "'border-image-slice'")) {
result = result.replace(RE_FILL_KEYWORD, ' ');
}
return result;
}
function normalizeGradient(parts, prefix){
/* Fix the degrees to the legacy syntax */
var val = parts[0];
// when the gradients were unprefixed, the w3c changed the way that the
// angle direction is interpreted. see:
// http://blogs.msdn.com/b/ie/archive/2012/06/25/unprefixed-css3-gradients-in-ie10.aspx
if (parts[1]) val += (prefix ? parseFloat((Math.abs(450 - parts[1]) % 360).toFixed(3)) : parts[1]) + 'deg';
/* Fix the directions to the legacy syntax */
if (prefix && parts[4]) {
// `to top` to `bottom` etc.
if (parts[5]) val += DIRECTIONS[parts[5]];
if (parts[6]) val += ' ' + DIRECTIONS[parts[7]];
} else if (!prefix && !parts[4]) {
// `top` to `to bottom` etc.
if (parts[5]) val += 'to ' + DIRECTIONS[parts[5]];
if (parts[6]) val += ' ' + DIRECTIONS[parts[7]];
} else {
if (parts[3]) val += parts[3];
}
return val;
}
var plugin = function(){
return function(style){
var nodes = this.nodes;
style.define('normalize', function(property, value, prefix) {
return new nodes.Ident(normalize(property, value, prefix));
});
};
};
module.exports = plugin;