Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
0cb702ba
Commit
0cb702ba
authored
Apr 05, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a few more builtins.
parent
13787485
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
context.cpp
context.cpp
+4
-0
functions.cpp
functions.cpp
+18
-1
functions.hpp
functions.hpp
+9
-0
input.scss
spec/basic/22_colors_with_alpha/input.scss
+6
-0
output.css
spec/basic/22_colors_with_alpha/output.css
+4
-1
No files found.
context.cpp
View file @
0cb702ba
...
...
@@ -33,6 +33,9 @@ namespace Sass {
register_function
(
rgb_descriptor
,
rgb
);
register_function
(
rgba_4_descriptor
,
rgba_4
);
register_function
(
rgba_2_descriptor
,
rgba_2
);
register_function
(
red_descriptor
,
red
);
register_function
(
green_descriptor
,
green
);
register_function
(
blue_descriptor
,
blue
);
}
}
\ No newline at end of file
functions.cpp
View file @
0cb702ba
#include "functions.hpp"
#include <iostream>
#
using
std
::
cerr
;
using
std
::
endl
;
namespace
Sass
{
...
...
@@ -35,6 +34,23 @@ namespace Sass {
return
bindings
[
parameters
[
0
]].
clone
()
<<
bindings
[
parameters
[
1
]];
}
Function_Descriptor
red_descriptor
=
{
"red"
,
"$color"
,
0
};
Node
red
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
)
{
return
bindings
[
parameters
[
0
]][
0
];
}
Function_Descriptor
green_descriptor
=
{
"green"
,
"$color"
,
0
};
Node
green
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
)
{
return
bindings
[
parameters
[
0
]][
1
];
}
Function_Descriptor
blue_descriptor
=
{
"blue"
,
"$color"
,
0
};
Node
blue
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
)
{
return
bindings
[
parameters
[
0
]][
2
];
}
}
}
\ No newline at end of file
functions.hpp
View file @
0cb702ba
...
...
@@ -51,6 +51,15 @@ namespace Sass {
extern
Function_Descriptor
rgba_2_descriptor
;
Node
rgba_2
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
);
extern
Function_Descriptor
red_descriptor
;
Node
red
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
);
extern
Function_Descriptor
green_descriptor
;
Node
green
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
);
extern
Function_Descriptor
blue_descriptor
;
Node
blue
(
const
vector
<
Token
>&
parameters
,
map
<
Token
,
Node
>&
bindings
);
}
}
spec/basic/22_colors_with_alpha/input.scss
View file @
0cb702ba
...
...
@@ -10,4 +10,10 @@ div {
floo
:
$x
;
bloo
:
rgba
(
$x
,
0
.7
);
groo
:
$x
;
$x
:
rgb
(
123
,
45
,
6
);
hoo
:
red
(
$x
);
moo
:
green
(
$x
);
poo
:
blue
(
$x
);
}
spec/basic/22_colors_with_alpha/output.css
View file @
0cb702ba
...
...
@@ -6,4 +6,7 @@ div {
blah
:
rgba
(
1
,
2
,
3
,
0.6
);
floo
:
aqua
;
bloo
:
rgba
(
0
,
255
,
255
,
0.7
);
groo
:
aqua
;
}
groo
:
aqua
;
hoo
:
123
;
moo
:
45
;
poo
:
6
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment