-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support string templates in Typescript
- Loading branch information
1 parent
0168a6d
commit 9a517e1
Showing
4 changed files
with
75 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import { jssPreset, StylesProvider, makeStyles } from '@material-ui/styles'; | ||
import { create } from 'jss'; | ||
import jssTemplate from 'jss-plugin-template'; | ||
|
||
const jss = create({ | ||
plugins: [jssTemplate(), ...jssPreset().plugins], | ||
}); | ||
|
||
const useStyles = makeStyles({ | ||
root: ` | ||
background: linear-gradient(45deg, #fe6b8b 30%, #ff8e53 90%); | ||
border-radius: 3px; | ||
font-size: 16px; | ||
border: 0; | ||
color: white; | ||
height: 48px; | ||
padding: 0 30px; | ||
box-shadow: 0 3px 5px 2px rgba(255, 105, 135, 0.3); | ||
`, | ||
}); | ||
|
||
function Child() { | ||
const classes = useStyles(); | ||
return ( | ||
<button type="button" className={classes.root}> | ||
String templates | ||
</button> | ||
); | ||
} | ||
|
||
function StringTemplates() { | ||
return ( | ||
<StylesProvider jss={jss}> | ||
<Child /> | ||
</StylesProvider> | ||
); | ||
} | ||
|
||
export default StringTemplates; |
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
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
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