diff --git a/tests/format/css/font/2595.css b/tests/format/css/font/2595.css new file mode 100644 index 000000000..0b163dccc --- /dev/null +++ b/tests/format/css/font/2595.css @@ -0,0 +1,12 @@ +@font-face { + font-family: "coolremote"; + src: url("/fonts/coolremote.eot"); + src: url("/fonts/coolremote.eot?#iefix") format("embedded-opentype"), + url("/fonts/coolremote.woff") format("woff"), + url("/fonts/coolremote.ttf") format("truetype"), + url("/f/x.ttf") format("svg"), + url("/f/y.ttf") format("svg"), + url("/fonts/coolremote.svg#coolremote") format("svg"); + font-weight: normal; + font-style: normal; +} diff --git a/tests/format/css/font/__snapshots__/format.test.js.snap b/tests/format/css/font/__snapshots__/format.test.js.snap index 0ca4760b9..247a2d498 100644 --- a/tests/format/css/font/__snapshots__/format.test.js.snap +++ b/tests/format/css/font/__snapshots__/format.test.js.snap @@ -1,5 +1,42 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing +exports[`2595.css format 1`] = ` +====================================options===================================== +parsers: ["css", "scss", "less"] +printWidth: 80 + | printWidth +=====================================input====================================== +@font-face { + font-family: "coolremote"; + src: url("/fonts/coolremote.eot"); + src: url("/fonts/coolremote.eot?#iefix") format("embedded-opentype"), + url("/fonts/coolremote.woff") format("woff"), + url("/fonts/coolremote.ttf") format("truetype"), + url("/f/x.ttf") format("svg"), + url("/f/y.ttf") format("svg"), + url("/fonts/coolremote.svg#coolremote") format("svg"); + font-weight: normal; + font-style: normal; +} + +=====================================output===================================== +@font-face { + font-family: "coolremote"; + src: url("/fonts/coolremote.eot"); + src: + url("/fonts/coolremote.eot?#iefix") format("embedded-opentype"), + url("/fonts/coolremote.woff") format("woff"), + url("/fonts/coolremote.ttf") format("truetype"), + url("/f/x.ttf") format("svg"), + url("/f/y.ttf") format("svg"), + url("/fonts/coolremote.svg#coolremote") format("svg"); + font-weight: normal; + font-style: normal; +} + +================================================================================ +`; + exports[`font.css format 1`] = ` ====================================options===================================== parsers: ["css", "scss", "less"] diff --git a/tests/format/less/less/__snapshots__/format.test.js.snap b/tests/format/less/less/__snapshots__/format.test.js.snap index c0834b037..440c6a047 100644 --- a/tests/format/less/less/__snapshots__/format.test.js.snap +++ b/tests/format/less/less/__snapshots__/format.test.js.snap @@ -1804,6 +1804,9 @@ label { .hello { &:extend(.input:disabled)} +// #6082 +margin: 0 @spacing-medium 0 -(@spacing-xxlarge + @spacing-medium); + =====================================output===================================== @nice-blue: #5b83ad; @light-blue: @nice-blue + #111; @@ -3447,6 +3450,9 @@ label { &:extend(.input:disabled); } +// #6082 +margin: 0 @spacing-medium 0 -(@spacing-xxlarge + @spacing-medium); + ================================================================================ `; diff --git a/tests/format/less/less/less.less b/tests/format/less/less/less.less index e03c99df8..c3b2e94a3 100644 --- a/tests/format/less/less/less.less +++ b/tests/format/less/less/less.less @@ -1694,3 +1694,6 @@ label { // #8177 .hello { &:extend(.input:disabled)} + +// #6082 +margin: 0 @spacing-medium 0 -(@spacing-xxlarge + @spacing-medium); diff --git a/tests/format/scss/comments/14544.scss b/tests/format/scss/comments/14544.scss new file mode 100644 index 000000000..bdb7f7fa0 --- /dev/null +++ b/tests/format/scss/comments/14544.scss @@ -0,0 +1,7 @@ +$blah: ( + "a": 42, + /* test test test test test test test test test test test test test test test*/ + /* test test test test test test test test test test test test test test test*/ + "b": 43, + "c": 44, +) diff --git a/tests/format/scss/comments/__snapshots__/format.test.js.snap b/tests/format/scss/comments/__snapshots__/format.test.js.snap index 0d3941d30..0265db4a5 100644 --- a/tests/format/scss/comments/__snapshots__/format.test.js.snap +++ b/tests/format/scss/comments/__snapshots__/format.test.js.snap @@ -189,6 +189,32 @@ printWidth: 80 ================================================================================ `; +exports[`14544.scss format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 + | printWidth +=====================================input====================================== +$blah: ( + "a": 42, + /* test test test test test test test test test test test test test test test*/ + /* test test test test test test test test test test test test test test test*/ + "b": 43, + "c": 44, +) + +=====================================output===================================== +$blah: ( + "a": 42, + /* test test test test test test test test test test test test test test test*/ + /* test test test test test test test test test test test test test test test*/ + "b": 43, + "c": 44, +); + +================================================================================ +`; + exports[`CRLF.scss format 1`] = ` ====================================options===================================== parsers: ["scss"] diff --git a/tests/format/scss/interpolation/4745.scss b/tests/format/scss/interpolation/4745.scss new file mode 100644 index 000000000..7fb609677 --- /dev/null +++ b/tests/format/scss/interpolation/4745.scss @@ -0,0 +1,15 @@ +$foo-area: foo; +$bar-area: bar; + +.grid-fails { + grid-template-areas: + "#{$foo-area} #{$foo-area}" + "#{$bar-area} #{$foo-area}"; +} + +.grid-works { + grid-template-areas: + " #{$foo-area} #{$foo-area}" + " #{$bar-area} #{$foo-area}"; +} + diff --git a/tests/format/scss/interpolation/__snapshots__/format.test.js.snap b/tests/format/scss/interpolation/__snapshots__/format.test.js.snap index 59ca451c7..ef94b37c2 100644 --- a/tests/format/scss/interpolation/__snapshots__/format.test.js.snap +++ b/tests/format/scss/interpolation/__snapshots__/format.test.js.snap @@ -679,3 +679,87 @@ a { ================================================================================ `; + +exports[`4745.scss - {"trailingComma":"es5"} format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 +trailingComma: "es5" + | printWidth +=====================================input====================================== +$foo-area: foo; +$bar-area: bar; + +.grid-fails { + grid-template-areas: + "#{$foo-area} #{$foo-area}" + "#{$bar-area} #{$foo-area}"; +} + +.grid-works { + grid-template-areas: + " #{$foo-area} #{$foo-area}" + " #{$bar-area} #{$foo-area}"; +} + + +=====================================output===================================== +$foo-area: foo; +$bar-area: bar; + +.grid-fails { + grid-template-areas: + "#{$foo-area} #{$foo-area}" + "#{$bar-area} #{$foo-area}"; +} + +.grid-works { + grid-template-areas: + " #{$foo-area} #{$foo-area}" + " #{$bar-area} #{$foo-area}"; +} + +================================================================================ +`; + +exports[`4745.scss - {"trailingComma":"none"} format 1`] = ` +====================================options===================================== +parsers: ["scss"] +printWidth: 80 +trailingComma: "none" + | printWidth +=====================================input====================================== +$foo-area: foo; +$bar-area: bar; + +.grid-fails { + grid-template-areas: + "#{$foo-area} #{$foo-area}" + "#{$bar-area} #{$foo-area}"; +} + +.grid-works { + grid-template-areas: + " #{$foo-area} #{$foo-area}" + " #{$bar-area} #{$foo-area}"; +} + + +=====================================output===================================== +$foo-area: foo; +$bar-area: bar; + +.grid-fails { + grid-template-areas: + "#{$foo-area} #{$foo-area}" + "#{$bar-area} #{$foo-area}"; +} + +.grid-works { + grid-template-areas: + " #{$foo-area} #{$foo-area}" + " #{$bar-area} #{$foo-area}"; +} + +================================================================================ +`;