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
2d0ba61c
Commit
2d0ba61c
authored
Oct 25, 2012
by
Gong Hao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add sass include_paths and output_style args
parent
5d331102
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
binding.cpp
binding.cpp
+2
-2
sass.js
sass.js
+18
-2
No files found.
binding.cpp
View file @
2d0ba61c
...
...
@@ -51,8 +51,8 @@ Handle<Value> Render(const Arguments& args) {
ctx
->
source_string
=
new
char
[
strlen
(
*
astr
)
+
1
];
strcpy
(
ctx
->
source_string
,
*
astr
);
ctx
->
options
.
include_paths
=
0
;
ctx
->
options
.
output_style
=
SASS_STYLE_NESTED
;
ctx
->
options
.
include_paths
=
args
[
2
]
;
ctx
->
options
.
output_style
=
args
[
3
]
;
ctx
->
callback
=
Persistent
<
Function
>::
New
(
callback
);
ctx
->
request
.
data
=
ctx
;
...
...
sass.js
View file @
2d0ba61c
...
...
@@ -13,6 +13,22 @@ try {
if
(
binding
===
null
)
{
throw
new
Error
(
'Cannot find appropriate binary library for node-sass'
);
}
exports
.
render
=
binding
.
render
var
toString
=
Object
.
prototype
.
toString
;
SASS_OUTPUT_STYLE
=
{
nested
:
0
,
expanded
:
1
,
compact
:
2
,
compressed
:
3
};
exports
.
render
=
function
(
css
,
callback
,
options
)
{
var
paths
,
style
;
if
(
toString
.
call
(
options
)
!==
'[object Object]'
)
{
options
=
{};
}
paths
=
options
.
include_paths
||
[];
if
(
!
((
style
=
options
.
output_style
)
in
SASS_OUTPUT_STYLE
))
{
style
=
'nested'
;
}
return
binding
.
render
(
css
,
callback
,
paths
.
join
(
':'
),
SASS_OUTPUT_STYLE
[
style
]);
};
exports
.
middleware
=
require
(
'./lib/middleware'
);
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