Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve new lines in Sass/Less files #229

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/nested-jsbeautifyrc/less/expected/test.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ a {
}
&.green {
color: @green;

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

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

.innerModal {
margin: auto;
background-color: @white;
Expand All @@ -18,21 +20,25 @@
-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 {
width: @container-width;
Expand All @@ -41,28 +47,33 @@
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;
Expand All @@ -71,69 +82,86 @@
//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;
display: none;
Expand Down
1 change: 1 addition & 0 deletions examples/nested-jsbeautifyrc/less/expected/test4.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ section#photo-details {
width: 1140px;
margin: 60px auto 70px;
}

div.photo-view {
text-align: center;
figure {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// https://github.com/Glavin001/atom-beautify/issues/180
.a {
color: #fff;

.b {
color: #999;
}
Expand Down
1 change: 1 addition & 0 deletions lib/langs/css-prettydiff-beautify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = (text, options, callback) ->
source: text
lang: "css"
mode: "beautify"
preserve: options.preserve_newlines
inchar: options.indent_character
insize: options.indent_size
alphasort: options.alphasort || false
Expand Down