File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -173,7 +173,11 @@ module.exports = {
173173 formatterOptions = Object . assign ( formatterOptions , options . fomatterOptions ) ;
174174 }
175175
176- return beautifyCss ( sassTreeResult , formatterOptions ) ;
176+ if ( options && options . formatOutput === true ) {
177+ return beautifyCss ( sassTreeResult , formatterOptions ) ;
178+ }
179+
180+ return sassTreeResult ;
177181 }
178182
179183 return null ;
Original file line number Diff line number Diff line change @@ -37,5 +37,33 @@ module.exports = {
3737 }
3838
3939 return string ;
40+ } ,
41+
42+ /**
43+ * Fix formatter SASS @apply tailwind broken colon (":") syntax
44+ *
45+ * Exp: @apply bg-white hover: shadow-2xl ...
46+ * ^^^
47+ * @param {string } content
48+ *
49+ * @return string
50+ */
51+ fixFomatterApplyIssue : function ( content ) {
52+ if ( content && content . length ) {
53+ var lines = content . split ( '\n' ) ,
54+ pattern = / @ a p p l y [ a - z A - Z 0 - 9 -_ \/ ] + [ a - z A - Z 0 - 9 -_ \/ ] + ( : ) [ a - z A - Z 0 - 9 -_ \/ ] + / gm;
55+
56+ for ( let i = 0 ; i < lines . length ; i ++ ) {
57+ const line = lines [ i ] ;
58+
59+ if ( line . match ( pattern ) ) {
60+ lines [ i ] = line . replace ( ': ' , ':' ) ;
61+ }
62+ }
63+
64+ return lines . join ( '\n' ) ;
65+ }
66+
67+ return content ;
4068 }
4169} ;
You can’t perform that action at this time.
0 commit comments