Skip to content

Commit

Permalink
Sass Transformer: Also look for partials
Browse files Browse the repository at this point in the history
Add support for [SASS partials](https://sass-lang.com/guide), as is already present [upstream](https://github.com/kristerkari/react-native-sass-transformer/blob/52884dd59582856fa17e2b2e8ca9efc37d412387/index.js#L41-L42).

This should fix the issue introduced by WordPress/gutenberg#19159, and discussed there.
  • Loading branch information
ockham committed Dec 16, 2019
1 parent 06b924d commit 0002811
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sass-transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ function findVariant( name, extensions, includePaths ) {
// try to find the file iterating through the extensions, in order.
const foundExtention = extensions.find( ( extension ) => {
const fname = includePath + '/' + name + extension;
return fs.existsSync( fname );
const partialfname = includePath + "/_" + name + extension;
return fs.existsSync( fname ) || fs.existsSync( partialfname );
} );

if ( foundExtention ) {
Expand Down

0 comments on commit 0002811

Please sign in to comment.