-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split the old `css` tag in: * `css`: generates scoped styles * `css.global`: generates global styles * `css.resolve`: resolves styles to an object which contains the scoped `className` and a drop-in `styles` element to render the styles Also introduces a macro (see babel-plugin-macros) for `css.resolve`
- Loading branch information
Showing
18 changed files
with
4,004 additions
and
874 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
module.exports = function() { | ||
function notTranspiledError(name) { | ||
throw new Error( | ||
'styled-jsx/css: if you are getting this error it means that your `css` tagged template literals were not transpiled.' | ||
'styled-jsx/css: if you are getting this error it means that your `' + | ||
name + | ||
'` tagged template literals were not transpiled.' | ||
) | ||
} | ||
function css() { | ||
notTranspiledError('css') | ||
} | ||
css.global = function() { | ||
notTranspiledError('global') | ||
} | ||
css.resolve = function() { | ||
notTranspiledError('resolve') | ||
} | ||
module.exports = css | ||
module.exports.global = css.global | ||
module.exports.resolve = css.resolve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./dist/macro') |
Oops, something went wrong.