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
ba8709ad
Commit
ba8709ad
authored
Mar 01, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getting arbitrarily nested empty rule-less blocks emitting correctly in expanded-style mode.
parent
13f04721
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
9 deletions
+59
-9
empty_levels.scss
empty_levels.scss
+38
-0
node.cpp
node.cpp
+5
-3
sassc.cpp
sassc.cpp
+5
-4
test.scss
test.scss
+11
-2
No files found.
empty_levels.scss
0 → 100644
View file @
ba8709ad
div
{
span
{
color
:
red
;
background
:
blue
;
}
}
div
{
color
:
gray
;
empty
{
span
{
color
:
red
;
background
:
blue
;
}
}
}
empty1
{
empty2
{
div
{
blah
:
blah
;
}
}
}
empty1
{
empty2
{
div
{
bloo
:
blee
;
empty3
{
span
{
blah
:
blah
;
blah
:
blah
;
}
}
}
}
}
node.cpp
View file @
ba8709ad
...
@@ -151,9 +151,11 @@ namespace Sass {
...
@@ -151,9 +151,11 @@ namespace Sass {
opt_children
[
i
].
emit_expanded_css
(
buf
,
prefix
);
opt_children
[
i
].
emit_expanded_css
(
buf
,
prefix
);
break
;
break
;
case
ruleset
:
case
ruleset
:
buf
<<
prefix
;
// buf << prefix;
if
(
children
[
1
].
children
.
size
()
>
0
)
if
(
children
[
1
].
children
.
size
()
>
0
)
{
children
[
0
].
emit_expanded_css
(
buf
,
prefix
);
buf
<<
prefix
<<
(
prefix
.
empty
()
?
""
:
" "
);
children
[
0
].
emit_expanded_css
(
buf
,
""
);
}
string
newprefix
(
prefix
.
empty
()
?
prefix
:
prefix
+
" "
);
string
newprefix
(
prefix
.
empty
()
?
prefix
:
prefix
+
" "
);
children
[
1
].
emit_expanded_css
(
buf
,
newprefix
+
string
(
children
[
0
].
token
));
children
[
1
].
emit_expanded_css
(
buf
,
newprefix
+
string
(
children
[
0
].
token
));
break
;
break
;
...
...
sassc.cpp
View file @
ba8709ad
...
@@ -13,11 +13,11 @@ int main(int argc, char* argv[]) {
...
@@ -13,11 +13,11 @@ int main(int argc, char* argv[]) {
Document
doc
(
argv
[
1
],
0
);
Document
doc
(
argv
[
1
],
0
);
doc
.
parse_scss
();
doc
.
parse_scss
();
// string output = doc.emit_css(doc.expanded);
string
output
=
doc
.
emit_css
(
doc
.
expanded
);
// cout << output;
// cout << endl;
string
output
=
doc
.
emit_css
(
doc
.
nested
);
cout
<<
output
;
cout
<<
output
;
cout
<<
endl
;
// string output = doc.emit_css(doc.nested);
// cout << output;
return
0
;
return
0
;
}
}
\ No newline at end of file
test.scss
View file @
ba8709ad
...
@@ -35,4 +35,13 @@ div {
...
@@ -35,4 +35,13 @@ div {
}
}
}
}
/* last comment, top level again --
/* last comment, top level again --
compare the indentation! */
compare the indentation! */
\ No newline at end of file
div
{
f
:
g
;
empty
{
span
{
a
:
b
;
}
}
}
\ 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