Commit 96760454 by Aral Balkan

Fixed the issue with mixin argument passing.

1 parent f2331af9
/* line 373 : stdin */
/* line 1 : /Users/aral/Ind.ie/products/site/source/assets/stylus/indie-style-core/responsive-pixels/node_modules/stylus/lib/functions/index.styl */
/* line 16 : stdin */
/************************************************************
* *
* Mixins: Helpers *
* *
************************************************************/
/* line 22 : stdin */
/* Convert unit to REMs if unit is in pixels. */
/* line 34 : stdin */
/* Abstract shorthand for attributes that can have 1-4 arguments
(top, right, left, bottom) */
/* line 87 : stdin */
/* Abstract longhand for attributes that take a single value */
/* line 102 : stdin */
/************************************************************
* *
* Mixins: CSS overrides *
* *
************************************************************/
/* line 109 : stdin */
/* Line height */
/* line 114 : stdin */
/* Margin */
/* line 131 : stdin */
/* Padding */
/* line 148 : stdin */
/* Font size */
/* line 153 : stdin */
/* Background size */
/* line 157 : stdin */
/* Max width */
/* line 165 : stdin */
/* Border */
/* line 203 : stdin */
/* Width */
/* line 211 : stdin */
/* Relative and absolute positioning */
/* line 226 : stdin */
/************************************************************
* *
* Typography *
* *
************************************************************/
/* line 157 : stdin */
/* line 153 : stdin */
/* line 1 : /Users/aral/Ind.ie/products/site/source/assets/stylus/indie-style-core/responsive-pixels/node_modules/stylus/lib/functions/index.styl */
......@@ -14,7 +14,9 @@ body {
width: 1000px;
width: 62.5rem;
margin: 24px;
margin: 1.5rem;
padding: 48px;
padding: 3rem;
line-height: 24px;
line-height: 1.5rem;
font-size: 18px;
......@@ -55,6 +57,7 @@ h2 {
/* line 33 : stdin */
#test-margin-inherit-parent-element {
margin: 42px;
margin: 2.625rem;
border: 1px dashed;
border: 0.0625rem dashed;
}
......@@ -72,6 +75,7 @@ h2 {
/* line 43 : stdin */
#test-margin-one-argument {
margin: 10px;
margin: 0.625rem;
}
/* line 46 : stdin */
......@@ -138,6 +142,7 @@ h2 {
/* line 78 : stdin */
#test-padding-one-argument {
padding: 10px;
padding: 0.625rem;
}
/* line 81 : stdin */
......@@ -249,7 +254,7 @@ h2 {
width: 31.25rem;
}
/* line 156 : stdin */
/* line 152 : stdin */
#test-padding-at-half-line-height {
padding: 12px 0 12px 12px;
/* Make sure that the rule is written out only once in case there is no rem substitution */
......
......@@ -35,23 +35,23 @@ remify(value)
/* Abstract shorthand for attributes that can have 1-4 arguments
(top, right, left, bottom) */
abstract-shorthand(attr, originalArguments)
abstract-shorthand(attr, args)
t = null
r = null
b = null
l = null
numOriginalArguments = length(originalArguments)
numOriginalArguments = length(args)
if length(originalArguments) >= 1
t = shift(originalArguments)
if length(originalArguments) >= 1
r = shift(originalArguments)
if length(originalArguments) >= 1
b = shift(originalArguments)
if length(originalArguments) >= 1
l = shift(originalArguments)
if length(args) >= 1
t = shift(args)
if length(args) >= 1
r = shift(args)
if length(args) >= 1
b = shift(args)
if length(args) >= 1
l = shift(args)
rT = remify(t)
rR = remify(r)
......@@ -82,7 +82,7 @@ abstract-shorthand(attr, originalArguments)
{attr} rT rR
else if numOriginalArguments == 1
{attr} t
if !(t = rT)
if !(t == rT)
{attr} rT
/* Abstract longhand for attributes that take a single value */
......@@ -110,58 +110,58 @@ abstract-longhand(attr, args)
/* Line height */
line-height(args...)
abstract-longhand('line-height', arguments)
abstract-longhand('line-height', args)
/* Margin */
margin(args...)
abstract-shorthand('margin', arguments)
abstract-shorthand('margin', args)
margin-top(args...)
abstract-longhand('margin-top', arguments)
abstract-longhand('margin-top', args)
margin-right(args...)
abstract-longhand('margin-right', arguments)
abstract-longhand('margin-right', args)
margin-bottom(args...)
abstract-longhand('margin-bottom', arguments)
abstract-longhand('margin-bottom', args)
margin-left(args...)
abstract-longhand('margin-left', arguments)
abstract-longhand('margin-left', args)
/* Padding */
padding(args...)
abstract-shorthand('padding', arguments)
abstract-shorthand('padding', args)
padding-top(args...)
abstract-longhand('padding-top', arguments)
abstract-longhand('padding-top', args)
padding-right(args...)
abstract-longhand('padding-right', arguments)
abstract-longhand('padding-right', args)
padding-bottom(args...)
abstract-longhand('padding-bottom', arguments)
abstract-longhand('padding-bottom', args)
padding-left(args...)
abstract-longhand('padding-left', arguments)
abstract-longhand('padding-left', args)
/* Font size */
font-size(args...)
abstract-longhand('font-size', arguments)
abstract-longhand('font-size', args)
/* Background size */
background-size(args...)
abstract-shorthand('background-size', arguments)
abstract-shorthand('background-size', args)
/* Max width */
max-width(args...)
abstract-longhand('max-width', arguments)
abstract-longhand('max-width', args)
max-height(args...)
abstract-longhand('max-height', arguments)
abstract-longhand('max-height', args)
/* Border */
......@@ -199,29 +199,29 @@ border-left(args...)
abstract-border('border-left', args, arguments)
border-radius()
abstract-longhand('border-radius', arguments)
abstract-longhand('border-radius', args)
/* Width */
width(args...)
abstract-longhand('width', arguments)
abstract-longhand('width', args)
height(args...)
abstract-longhand('height', arguments)
abstract-longhand('height', args)
/* Relative and absolute positioning */
top(args...)
abstract-longhand('top', arguments)
abstract-longhand('top', args)
bottom(args...)
abstract-longhand('bottom', arguments)
abstract-longhand('bottom', args)
left(args...)
abstract-longhand('left', arguments)
abstract-longhand('left', args)
right(args...)
abstract-longhand('right', arguments)
abstract-longhand('right', args)
/************************************************************
......
......@@ -101,7 +101,7 @@
</section>
<section>
<h2>Vertical rhythm helpers</h2>
<div id='test-padding-at-half-line-height' data-assert='padding: 12px 0px 12px 12px'>padding unit(HalfLineHeight, 'px') 0 …</div>
<div id='test-padding-at-half-line-height' data-assert='padding: 12px 0px 12px 12px'>padding HalfLineHeight 0 HalfLineHeight HalfLineHeight</div>
</section>
<script src='dom-style-test-runner.js'></script>
......
......@@ -148,10 +148,6 @@ h2
width 100px !important
width 500px
// Note: This might be a bug in Stylus — if a variable is repeated, as it is here,
// ===== It works only for x x x 0. Any other orientations only result in the last
// variable being used *unless* you explicitly wrap the variable in a unit()
// call as shown here.
// TODO: File this as a bug with the Stylus folks.
// Vertical rhythm helpers.
#test-padding-at-half-line-height
padding unit(HalfLineHeight, 'px') 0 unit(HalfLineHeight, 'px') unit(HalfLineHeight, 'px')
padding HalfLineHeight 0 HalfLineHeight HalfLineHeight
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!