Skip to content

wix-incubator/wix-tpa-style-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wix TPA style loader Build Status

Webpack loader that handles Wix TPA style params.

Installation

npm install wix-tpa-style-loader

Usage

scss file that contains TPA style params

.foo {
	color: unquote("{{color-1}}");
	font: unquote("; {{body-m}}");
	font-size: 16px;
}

If you are using Yoshi, just specify tpaStyle: true, it will invoke this loader as part of scss requires and it will pass the remain part.

// remain
.foo {
	font-size: 16px;
}

If you want to put a style tag with the TPA params you need to require SCSS file with wix-tpa-style?mode=inline.

require('!wix-tpa-style-loader?mode=inline!scss!./style.scss');

This require will generate code in your bundle that on runtime will put style tag with wix-style attr to the head and the inline part in it.

// inline
.foo {
	color: {{color-1}};
	font: ; {{body-m}};
}

Documentation: Using loaders

License

MIT (http://www.opensource.org/licenses/mit-license.php)

About

Webpack loader that handles TPA style params

Resources

License

Stars

Watchers

Forks

Packages

No packages published