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
6030f08c
Commit
6030f08c
authored
Feb 29, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expanded-style output is looking good.
parent
e476b60c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
8 deletions
+18
-8
node.cpp
src/node.cpp
+6
-3
node.hpp
src/node.hpp
+2
-1
test.scss
src/test.scss
+10
-4
No files found.
src/node.cpp
View file @
6030f08c
...
...
@@ -68,13 +68,15 @@ namespace Sass {
}
}
void
Node
::
emit_expanded_css
(
stringstream
&
buf
,
string
prefix
)
{
void
Node
::
emit_expanded_css
(
stringstream
&
buf
,
const
string
&
prefix
)
{
switch
(
type
)
{
case
value
:
case
selector
:
if
(
!
prefix
.
empty
())
buf
<<
" "
;
buf
<<
string
(
token
);
break
;
case
comment
:
if
(
!
prefix
.
empty
())
buf
<<
" "
;
buf
<<
string
(
token
)
<<
endl
;
break
;
case
property
:
...
...
@@ -99,9 +101,10 @@ namespace Sass {
opt_children
[
i
].
emit_expanded_css
(
buf
,
prefix
);
break
;
case
ruleset
:
buf
<<
prefix
<<
" "
;
buf
<<
prefix
;
children
[
0
].
emit_expanded_css
(
buf
,
prefix
);
children
[
1
].
emit_expanded_css
(
buf
,
prefix
+
string
(
children
[
0
].
token
));
string
newprefix
(
prefix
.
empty
()
?
prefix
:
prefix
+
" "
);
children
[
1
].
emit_expanded_css
(
buf
,
newprefix
+
string
(
children
[
0
].
token
));
break
;
}
}
...
...
src/node.hpp
View file @
6030f08c
...
...
@@ -33,6 +33,6 @@ namespace Sass {
void
push_child
(
const
Node
&
node
);
void
push_opt_child
(
const
Node
&
node
);
void
dump
(
unsigned
int
depth
=
0
);
void
emit_expanded_css
(
std
::
stringstream
&
buf
,
string
prefix
);
void
emit_expanded_css
(
std
::
stringstream
&
buf
,
const
string
&
prefix
);
};
}
\ No newline at end of file
src/test.scss
View file @
6030f08c
/* top level comment -- should preserved */
div
{
/* a comment that should be preserved */
/* a
nother
comment that should be preserved */
color
:
red
;
background
:
blue
;
span
{
...
...
@@ -8,8 +9,13 @@ div {
text-decoration
:
none
;
color
:
green
;
}
/*
second
comment that should be preserved */
/*
yet another
comment that should be preserved */
display
:
inline-block
;
}
p
{
padding
:
10px
8%
;
}
margin
:
10px
5px
;
}
\ No newline at end of file
}
/* last comment, top level again --
compare the indentation! */
\ No newline at end of file
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