Skip to content

Commit

Permalink
Clean up LESS/SCSS Unit Tests and update Prettydiff
Browse files Browse the repository at this point in the history
Fixes #181 and fixes #180.
  • Loading branch information
Glavin001 committed Feb 2, 2015
1 parent 617317a commit a50c5a3
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 40 deletions.
6 changes: 0 additions & 6 deletions examples/nested-jsbeautifyrc/less/expected/test.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
a {
line-height: @headerHeight;

display: block;
padding: 0 15px;
font-size: 16px;
Expand All @@ -9,23 +8,18 @@ a {
}
&:link {
color: @white;

text-decoration: none;
}
&:visited {
color: @white;

}
&:hover {
color: @orange;

}
&.green {
color: @green;

&:hover {
color: @white;

background-color: @green;
}
}
Expand Down
29 changes: 0 additions & 29 deletions examples/nested-jsbeautifyrc/less/expected/test2.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// main: style.less
@import (reference)"variables.less";
@import (reference)"mixins.less";

.modal {
position: fixed;
height: 100%;
Expand All @@ -10,7 +9,6 @@
z-index: 10;
opacity: 0;
display: none;

.innerModal {
margin: auto;
background-color: @white;
Expand All @@ -20,24 +18,20 @@
-ms-transform: translateY(-100%);
-o-transform: translateY(-100%);
transform: translateY(-100%);

.fa {
float: right;
color: @white;
background-color: firebrick;
padding: 5px 7px;
border-radius: 20px;

&:hover {
background-color: lighten(@black, 50%);
cursor: pointer;

}
&:active {
background-color: lighten(@black, 25%);
}
}

}
&.modal-2text {
.innerModal {
Expand All @@ -47,121 +41,98 @@
padding: 10px 25px;
background-color: gainsboro;
border-radius: 4px;

h2 {
margin: 0 0 7px;

}
div {
height: 70%;
overflow-y: scroll;
background-color: @white;
padding: 15px;
border-radius: 4px;

}
.large-cta {
margin-top: 25px;
}
}
}

}
#modal-video {
.innerModal {
left: 10%;
margin-top: 30px;
width: 1000px;
background-color: lighten(@black, 25%);

iframe {
width: 600px;
height: 340px;
margin: 2% auto;

}
//container
> div {
text-align: center;

a {
.styleLinks(@white, darken(@white, 10%));
padding: 5px;
text-transform: uppercase;

&:hover {
background-color: fade(@white, 15%);

}
&:active {
background-color: fade(@white, 30%);
}

}
h3 {
color: @white;
font-size: 3em;
margin: 20px auto;

}
button {
margin-bottom: 50px;
}
}
}

}
.slideIn {
.animation(SlideIn, 0.5s);

}
@-webkit-keyframes SlideIn {
0% {
.transform(translateY(-100%));

}
100% {
.transform(translateY(0px));
}

}
.fadeIn {
display: block;
.animation(FadeIn, 0.5s);

}
@-webkit-keyframes FadeIn {
0% {
opacity: 0;

}
100% {
opacity: 1;
}

}
.slideOut {
.animation(SlideOut, 0.5s);

}
@-webkit-keyframes SlideOut {
0% {
.transform(translateY(0%));

}
100% {
.transform(translateY(-100%));
}

}
.fadeOut {
.animation(FadeOut, 0.5s);

}
@-webkit-keyframes FadeOut {
0% {
opacity: 1;

}
100% {
opacity: 0;
Expand Down
2 changes: 0 additions & 2 deletions examples/nested-jsbeautifyrc/less/expected/test3.less
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Breaks (fixed now)
.mixin(@variable, @anotherVariable) {


}
// Works
.mixin(@variable; @anotherVariable) {


}
// Ok
.mixin(@variable) {
Expand Down
1 change: 0 additions & 1 deletion examples/nested-jsbeautifyrc/less/expected/test4.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
section#photo-details {
width: 1140px;
margin: 60px auto 70px;

}
div.photo-view {
text-align: center;
Expand Down
11 changes: 11 additions & 0 deletions examples/nested-jsbeautifyrc/sass/expected/extra-line-test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// https://github.com/Glavin001/atom-beautify/issues/181
.ttl {
margin-bottom: 10px;
}
// https://github.com/Glavin001/atom-beautify/issues/180
.a {
color: #fff;
.b {
color: #999;
}
}
14 changes: 14 additions & 0 deletions examples/nested-jsbeautifyrc/sass/original/extra-line-test.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// https://github.com/Glavin001/atom-beautify/issues/181
.ttl {
margin-bottom: 10px;
}


// https://github.com/Glavin001/atom-beautify/issues/180
.a {
color: #fff;

.b {
color: #999;
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/language-options.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ module.exports =
text = beautifyCSS(text, self.getOptions("css", allOptions))
beautifyCompleted text
when "Sass", "SCSS", "LESS"
beautifyLESS ?= require("./langs/less-beautify")
beautifyLESS ?= require("./langs/css-prettydiff-beautify")
beautifyLESS text, self.getOptions("css", allOptions), beautifyCompleted
when "SQL (Rails)", "SQL"
beautifySQL ?= require("./langs/sql-beautify")
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"loophole": "^1.0.0",
"node-dir": "^0.1.6",
"node-uuid": "^1.4.1",
"prettydiff": "^1.6.13",
"prettydiff": "^1.8.8",
"space-pen": "^4.3.0",
"strip-json-comments": "^0.1.3",
"temp": "^0.8.0",
Expand Down

0 comments on commit a50c5a3

Please sign in to comment.