diff --git a/.all-contributorsrc b/.all-contributorsrc index b253aba3..43aea70b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -586,6 +586,16 @@ "contributions": [ "test" ] + }, + { + "login": "whtsky", + "name": "Wu Haotian", + "avatar_url": "https://avatars3.githubusercontent.com/u/876694?v=4", + "profile": "https://github.com/whtsky", + "contributions": [ + "code", + "test" + ] } ] } diff --git a/README.md b/README.md index e50d0254..77f35ebc 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ [![downloads][downloads-badge]][npmcharts] [![MIT License][license-badge]][license] -[![All Contributors](https://img.shields.io/badge/all_contributors-61-orange.svg?style=flat-square)](#contributors) +[![All Contributors](https://img.shields.io/badge/all_contributors-62-orange.svg?style=flat-square)](#contributors) [![PRs Welcome][prs-badge]][prs] [![Chat][chat-badge]][chat] [![Code of Conduct][coc-badge]][coc] @@ -164,16 +164,16 @@ Thanks goes to these people ([emoji key][emojis]): -| [
Kent C. Dodds](https://kentcdodds.com)
[πŸ’»](/paypal/glamorous/commits?author=kentcdodds "Code") [πŸ“–](/paypal/glamorous/commits?author=kentcdodds "Documentation") [πŸš‡](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](/paypal/glamorous/commits?author=kentcdodds "Tests") [πŸ‘€](#review-kentcdodds "Reviewed Pull Requests") | [
Ives van Hoorne](http://ivesvh.com)
[πŸ’‘](#example-CompuIves "Examples") | [
Gerardo Nardelli](https://gnardelli.com)
[πŸ“–](/paypal/glamorous/commits?author=patitonar "Documentation") | [
Chandan Rai](https://github.com/crowchirp)
[πŸ“–](/paypal/glamorous/commits?author=crowchirp "Documentation") | [
BinHong Lee](https://binhonglee.github.io)
[πŸ“–](/paypal/glamorous/commits?author=binhonglee "Documentation") | [
Paul Molluzzo](https://paul.molluzzo.com)
[πŸ“–](/paypal/glamorous/commits?author=paulmolluzzo "Documentation") [πŸ’‘](#example-paulmolluzzo "Examples") | [
Sriram Thiagarajan](http://tsriram.in)
[πŸ’»](/paypal/glamorous/commits?author=tsriram "Code") | +| [
Kent C. Dodds](https://kentcdodds.com)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=kentcdodds "Code") [πŸ“–](https://github.com/paypal/glamorous/commits?author=kentcdodds "Documentation") [πŸš‡](#infra-kentcdodds "Infrastructure (Hosting, Build-Tools, etc)") [⚠️](https://github.com/paypal/glamorous/commits?author=kentcdodds "Tests") [πŸ‘€](#review-kentcdodds "Reviewed Pull Requests") | [
Ives van Hoorne](http://ivesvh.com)
[πŸ’‘](#example-CompuIves "Examples") | [
Gerardo Nardelli](https://gnardelli.com)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=patitonar "Documentation") | [
Chandan Rai](https://github.com/crowchirp)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=crowchirp "Documentation") | [
BinHong Lee](https://binhonglee.github.io)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=binhonglee "Documentation") | [
Paul Molluzzo](https://paul.molluzzo.com)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=paulmolluzzo "Documentation") [πŸ’‘](#example-paulmolluzzo "Examples") | [
Sriram Thiagarajan](http://tsriram.in)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=tsriram "Code") | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | -| [
Pavithra Kodmad](https://github.com/pksjce)
[πŸ’‘](#example-pksjce "Examples") | [
Alessandro Arnodo](http://alessandro.arnodo.net)
[πŸ’»](/paypal/glamorous/commits?author=vesparny "Code") [πŸ“–](/paypal/glamorous/commits?author=vesparny "Documentation") [⚠️](/paypal/glamorous/commits?author=vesparny "Tests") | [
Jason Miller](https://jasonformat.com)
[πŸ‘€](#review-developit "Reviewed Pull Requests") | [
Kyle Welch](http://www.krwelch.com)
[πŸ‘€](#review-kwelch "Reviewed Pull Requests") [πŸ’‘](#example-kwelch "Examples") | [
Javi Velasco](http://javivelasco.com)
[πŸ‘€](#review-javivelasco "Reviewed Pull Requests") | [
Brandon Dail](https://twitter.com/aweary)
[πŸ‘€](#review-aweary "Reviewed Pull Requests") | [
Jason Brown](http://browniefed.com)
[πŸ‘€](#review-browniefed "Reviewed Pull Requests") | -| [
jackyho112](https://github.com/jackyho112)
[πŸ’»](/paypal/glamorous/commits?author=jackyho112 "Code") [⚠️](/paypal/glamorous/commits?author=jackyho112 "Tests") | [
Kurtis Kemple](https://twitter.com/kurtiskemple)
[πŸ’»](/paypal/glamorous/commits?author=kkemple "Code") [⚠️](/paypal/glamorous/commits?author=kkemple "Tests") [πŸ“–](/paypal/glamorous/commits?author=kkemple "Documentation") | [
Bernardo Raposo](http://bernardoraposo.com)
[πŸ“–](/paypal/glamorous/commits?author=braposo "Documentation") [πŸ’‘](#example-braposo "Examples") | [
Ryan Delaney](http://rdel.io)
[πŸ’»](/paypal/glamorous/commits?author=rrdelaney "Code") | [
Anthony Ng](http://anthonyng.me)
[πŸ“–](/paypal/glamorous/commits?author=newyork-anthonyng "Documentation") | [
Matthew Crutchfield](http://cnn.com)
[πŸ’‘](#example-mtcrutch "Examples") | [
Kye Hohenberger](https://github.com/tkh44)
[πŸ’»](/paypal/glamorous/commits?author=tkh44 "Code") [⚠️](/paypal/glamorous/commits?author=tkh44 "Tests") [πŸ“–](/paypal/glamorous/commits?author=tkh44 "Documentation") | -| [
Bernard Lin](https://github.com/bernard-lin)
[πŸ“–](/paypal/glamorous/commits?author=bernard-lin "Documentation") [πŸ”Œ](#plugin-bernard-lin "Plugin/utility libraries") | [
Miguel Correa](http://miguelc1221.github.io/)
[πŸ’»](/paypal/glamorous/commits?author=miguelc1221 "Code") | [
Brian Hough](http://rallypoint.gg)
[πŸ’‘](#example-bhough "Examples") | [
Erik Cupal](https://github.com/ErikCupal)
[πŸ’»](/paypal/glamorous/commits?author=ErikCupal "Code") | [
Kok J Sam](https://github.com/sammkj)
[πŸ’»](/paypal/glamorous/commits?author=sammkj "Code") | [
Oleg Proskurin](http://twitter.com/#!/usulpro)
[πŸ“–](/paypal/glamorous/commits?author=UsulPro "Documentation") | [
Luke John](https://github.com/luke-john)
[πŸ’»](/paypal/glamorous/commits?author=luke-john "Code") | -| [
FredericH](http://fr.linkedin.com/in/fredericheem)
[πŸ’‘](#example-FredericHeem "Examples") | [
Atticus White](https://atticuswhite.com)
[πŸ“–](/paypal/glamorous/commits?author=ajwhite "Documentation") [πŸ”Œ](#plugin-ajwhite "Plugin/utility libraries") | [
marzelin](https://github.com/marzelin)
[πŸ’»](/paypal/glamorous/commits?author=marzelin "Code") | [
iwantmyname](https://iwantmyname.com/)
[πŸš‡](#infra-iwantmyname "Infrastructure (Hosting, Build-Tools, etc)") | [
Ethan Godt](http://ethangodt.com)
| [
Zill Ding](https://github.com/zillding)
[πŸ’»](/paypal/glamorous/commits?author=zillding "Code") | [
Dan Bradley](https://github.com/debradley)
[πŸ’»](/paypal/glamorous/commits?author=debradley "Code") | -| [
Lufty Wiranda](http://instagram.com/luftywiranda13)
[πŸ’»](/paypal/glamorous/commits?author=luftywiranda13 "Code") | [
Ansuman Shah](https://github.com/ansumanshah)
[πŸ’»](/paypal/glamorous/commits?author=ansumanshah "Code") [πŸ“–](/paypal/glamorous/commits?author=ansumanshah "Documentation") | [
Travis LaDuke](http://-)
[πŸ’‘](#example-laduke "Examples") | [
AydΔ±n Γ‡ağrΔ± Dumlu](https://github.com/acgrdumlu)
[πŸ›](/paypal/glamorous/issues?q=author%3Aacgrdumlu "Bug reports") [πŸ’»](/paypal/glamorous/commits?author=acgrdumlu "Code") | [
Maja Wichrowska](https://github.com/majapw)
[πŸ›](/paypal/glamorous/issues?q=author%3Amajapw "Bug reports") | [
Tom Liu](https://github.com/gt3240)
[πŸ“–](/paypal/glamorous/commits?author=gt3240 "Documentation") | [
Siddharth Kshetrapal](https://github.com/siddharthkp)
[⚠️](/paypal/glamorous/commits?author=siddharthkp "Tests") [πŸ”§](#tool-siddharthkp "Tools") | -| [
WillowHQ](https://github.com/WillowHQ)
[πŸ“–](/paypal/glamorous/commits?author=WillowHQ "Documentation") | [
Mohammad Rajabifard](https://tarino.ir)
[πŸ›](/paypal/glamorous/issues?q=author%3Amorajabi "Bug reports") [πŸ“–](/paypal/glamorous/commits?author=morajabi "Documentation") | [
Omar Albacha](https://github.com/Oalbacha)
[πŸ’»](/paypal/glamorous/commits?author=Oalbacha "Code") [πŸ“–](/paypal/glamorous/commits?author=Oalbacha "Documentation") | [
tdeschryver](https://github.com/tdeschryver)
[πŸ’»](/paypal/glamorous/commits?author=tdeschryver "Code") [⚠️](/paypal/glamorous/commits?author=tdeschryver "Tests") | [
Dylan Mozlowski](https://github.com/DylanMoz)
[πŸ’»](/paypal/glamorous/commits?author=DylanMoz "Code") | [
andretshurotshka](https://github.com/goodmind)
[πŸ’»](/paypal/glamorous/commits?author=goodmind "Code") [⚠️](/paypal/glamorous/commits?author=goodmind "Tests") | [
Danila](https://github.com/O4epegb)
[⚠️](/paypal/glamorous/commits?author=O4epegb "Tests") | -| [
Junyoung Clare Jang](http://ailrun.github.io/)
[πŸ’»](/paypal/glamorous/commits?author=Ailrun "Code") [⚠️](/paypal/glamorous/commits?author=Ailrun "Tests") | [
BjΓΆrn Ricks](https://twitter.com/bjoernricks)
[πŸ›](/paypal/glamorous/issues?q=author%3Abjoernricks "Bug reports") [πŸ’»](/paypal/glamorous/commits?author=bjoernricks "Code") [πŸ“–](/paypal/glamorous/commits?author=bjoernricks "Documentation") [⚠️](/paypal/glamorous/commits?author=bjoernricks "Tests") | [
Tyler Deitz](http://tylerdeitz.com)
[πŸ’»](/paypal/glamorous/commits?author=tvler "Code") | [
Shovan Chatterjee](https://twitter.com/shovan_ch)
[πŸ“–](/paypal/glamorous/commits?author=shovanch "Documentation") | [
johnjessewood](https://github.com/johnjesse)
[πŸ’»](/paypal/glamorous/commits?author=johnjesse "Code") | [
Daniel](https://www.danielberndt.net)
[πŸ’»](/paypal/glamorous/commits?author=danielberndt "Code") [⚠️](/paypal/glamorous/commits?author=danielberndt "Tests") | [
Ken Powers](https://knpw.rs)
[πŸ€”](#ideas-knpwrs "Ideas, Planning, & Feedback") [πŸ’‘](#example-knpwrs "Examples") | -| [
John Grishin](http://johngrish.in)
[πŸ›](/paypal/glamorous/issues?q=author%3Aexah "Bug reports") [πŸ’»](/paypal/glamorous/commits?author=exah "Code") [⚠️](/paypal/glamorous/commits?author=exah "Tests") | [
Mordy Tikotzky](https://github.com/tikotzky)
[πŸ›](/paypal/glamorous/issues?q=author%3Atikotzky "Bug reports") [πŸ’»](/paypal/glamorous/commits?author=tikotzky "Code") | [
Alasdair McLeay](https://github.com/penx)
[πŸ’‘](#example-penx "Examples") | [
Ardamis Yeshak](https://github.com/zabute)
[πŸ”§](#tool-zabute "Tools") | [
Matthew Armstrong](https://github.com/raingerber)
[⚠️](/paypal/glamorous/commits?author=raingerber "Tests") | +| [
Pavithra Kodmad](https://github.com/pksjce)
[πŸ’‘](#example-pksjce "Examples") | [
Alessandro Arnodo](http://alessandro.arnodo.net)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=vesparny "Code") [πŸ“–](https://github.com/paypal/glamorous/commits?author=vesparny "Documentation") [⚠️](https://github.com/paypal/glamorous/commits?author=vesparny "Tests") | [
Jason Miller](https://jasonformat.com)
[πŸ‘€](#review-developit "Reviewed Pull Requests") | [
Kyle Welch](http://www.krwelch.com)
[πŸ‘€](#review-kwelch "Reviewed Pull Requests") [πŸ’‘](#example-kwelch "Examples") | [
Javi Velasco](http://javivelasco.com)
[πŸ‘€](#review-javivelasco "Reviewed Pull Requests") | [
Brandon Dail](https://twitter.com/aweary)
[πŸ‘€](#review-aweary "Reviewed Pull Requests") | [
Jason Brown](http://browniefed.com)
[πŸ‘€](#review-browniefed "Reviewed Pull Requests") | +| [
jackyho112](https://github.com/jackyho112)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=jackyho112 "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=jackyho112 "Tests") | [
Kurtis Kemple](https://twitter.com/kurtiskemple)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=kkemple "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=kkemple "Tests") [πŸ“–](https://github.com/paypal/glamorous/commits?author=kkemple "Documentation") | [
Bernardo Raposo](http://bernardoraposo.com)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=braposo "Documentation") [πŸ’‘](#example-braposo "Examples") | [
Ryan Delaney](http://rdel.io)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=rrdelaney "Code") | [
Anthony Ng](http://anthonyng.me)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=newyork-anthonyng "Documentation") | [
Matthew Crutchfield](http://cnn.com)
[πŸ’‘](#example-mtcrutch "Examples") | [
Kye Hohenberger](https://github.com/tkh44)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=tkh44 "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=tkh44 "Tests") [πŸ“–](https://github.com/paypal/glamorous/commits?author=tkh44 "Documentation") | +| [
Bernard Lin](https://github.com/bernard-lin)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=bernard-lin "Documentation") [πŸ”Œ](#plugin-bernard-lin "Plugin/utility libraries") | [
Miguel Correa](http://miguelc1221.github.io/)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=miguelc1221 "Code") | [
Brian Hough](http://rallypoint.gg)
[πŸ’‘](#example-bhough "Examples") | [
Erik Cupal](https://github.com/ErikCupal)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=ErikCupal "Code") | [
Kok J Sam](https://github.com/sammkj)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=sammkj "Code") | [
Oleg Proskurin](http://twitter.com/#!/usulpro)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=UsulPro "Documentation") | [
Luke John](https://github.com/luke-john)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=luke-john "Code") | +| [
FredericH](http://fr.linkedin.com/in/fredericheem)
[πŸ’‘](#example-FredericHeem "Examples") | [
Atticus White](https://atticuswhite.com)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=ajwhite "Documentation") [πŸ”Œ](#plugin-ajwhite "Plugin/utility libraries") | [
marzelin](https://github.com/marzelin)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=marzelin "Code") | [
iwantmyname](https://iwantmyname.com/)
[πŸš‡](#infra-iwantmyname "Infrastructure (Hosting, Build-Tools, etc)") | [
Ethan Godt](http://ethangodt.com)
| [
Zill Ding](https://github.com/zillding)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=zillding "Code") | [
Dan Bradley](https://github.com/debradley)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=debradley "Code") | +| [
Lufty Wiranda](http://instagram.com/luftywiranda13)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=luftywiranda13 "Code") | [
Ansuman Shah](https://github.com/ansumanshah)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=ansumanshah "Code") [πŸ“–](https://github.com/paypal/glamorous/commits?author=ansumanshah "Documentation") | [
Travis LaDuke](http://-)
[πŸ’‘](#example-laduke "Examples") | [
AydΔ±n Γ‡ağrΔ± Dumlu](https://github.com/acgrdumlu)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Aacgrdumlu "Bug reports") [πŸ’»](https://github.com/paypal/glamorous/commits?author=acgrdumlu "Code") | [
Maja Wichrowska](https://github.com/majapw)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Amajapw "Bug reports") | [
Tom Liu](https://github.com/gt3240)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=gt3240 "Documentation") | [
Siddharth Kshetrapal](https://github.com/siddharthkp)
[⚠️](https://github.com/paypal/glamorous/commits?author=siddharthkp "Tests") [πŸ”§](#tool-siddharthkp "Tools") | +| [
WillowHQ](https://github.com/WillowHQ)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=WillowHQ "Documentation") | [
Mohammad Rajabifard](https://tarino.ir)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Amorajabi "Bug reports") [πŸ“–](https://github.com/paypal/glamorous/commits?author=morajabi "Documentation") | [
Omar Albacha](https://github.com/Oalbacha)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=Oalbacha "Code") [πŸ“–](https://github.com/paypal/glamorous/commits?author=Oalbacha "Documentation") | [
tdeschryver](https://github.com/tdeschryver)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=tdeschryver "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=tdeschryver "Tests") | [
Dylan Mozlowski](https://github.com/DylanMoz)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=DylanMoz "Code") | [
andretshurotshka](https://github.com/goodmind)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=goodmind "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=goodmind "Tests") | [
Danila](https://github.com/O4epegb)
[⚠️](https://github.com/paypal/glamorous/commits?author=O4epegb "Tests") | +| [
Junyoung Clare Jang](http://ailrun.github.io/)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=Ailrun "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=Ailrun "Tests") | [
BjΓΆrn Ricks](https://twitter.com/bjoernricks)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Abjoernricks "Bug reports") [πŸ’»](https://github.com/paypal/glamorous/commits?author=bjoernricks "Code") [πŸ“–](https://github.com/paypal/glamorous/commits?author=bjoernricks "Documentation") [⚠️](https://github.com/paypal/glamorous/commits?author=bjoernricks "Tests") | [
Tyler Deitz](http://tylerdeitz.com)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=tvler "Code") | [
Shovan Chatterjee](https://twitter.com/shovan_ch)
[πŸ“–](https://github.com/paypal/glamorous/commits?author=shovanch "Documentation") | [
johnjessewood](https://github.com/johnjesse)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=johnjesse "Code") | [
Daniel](https://www.danielberndt.net)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=danielberndt "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=danielberndt "Tests") | [
Ken Powers](https://knpw.rs)
[πŸ€”](#ideas-knpwrs "Ideas, Planning, & Feedback") [πŸ’‘](#example-knpwrs "Examples") | +| [
John Grishin](http://johngrish.in)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Aexah "Bug reports") [πŸ’»](https://github.com/paypal/glamorous/commits?author=exah "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=exah "Tests") | [
Mordy Tikotzky](https://github.com/tikotzky)
[πŸ›](https://github.com/paypal/glamorous/issues?q=author%3Atikotzky "Bug reports") [πŸ’»](https://github.com/paypal/glamorous/commits?author=tikotzky "Code") | [
Alasdair McLeay](https://github.com/penx)
[πŸ’‘](#example-penx "Examples") | [
Ardamis Yeshak](https://github.com/zabute)
[πŸ”§](#tool-zabute "Tools") | [
Matthew Armstrong](https://github.com/raingerber)
[⚠️](https://github.com/paypal/glamorous/commits?author=raingerber "Tests") | [
Wu Haotian](https://github.com/whtsky)
[πŸ’»](https://github.com/paypal/glamorous/commits?author=whtsky "Code") [⚠️](https://github.com/paypal/glamorous/commits?author=whtsky "Tests") | diff --git a/test/glamorous.test.tsx b/test/glamorous.test.tsx index 25cfd92c..ac221737 100644 --- a/test/glamorous.test.tsx +++ b/test/glamorous.test.tsx @@ -1,18 +1,15 @@ -import * as React from "react"; -import glamorous, { - withTheme, ThemeProvider -} from "../"; +import * as React from 'react' +import glamorous, {withTheme, ThemeProvider} from '../' // Needed if generating definition files // https://github.com/Microsoft/TypeScript/issues/5938 -import { GlamorousComponent, GlamorousComponentProps } from "../"; - -import { CSSPropertiesPseudo, CSSPropertiesLossy } from "../" +import {GlamorousComponent, GlamorousComponentProps} from '../' +import {CSSPropertiesPseudo, CSSPropertiesLossy} from '../' // Glamorous built in Components named exports -import { Article, H1, P } from '../' +import {Article, H1, P} from '../' const useBuiltInNamedExports = (
@@ -21,12 +18,13 @@ const useBuiltInNamedExports = (
) - // Properties const Static = glamorous.div({ - "fontSize": 20, - "textAlign": "center", -}); + fontSize: 20, + textAlign: 'center', + grid: 'auto-flow dense / 40px 40px 1fr', + gridTemplate: 'fit-content(100px) / fit-content(40%)', +}) // multi level nested properties @@ -34,229 +32,217 @@ glamorous.div({ ':hover': { '& .vendor-class': { height: '10px', - } - } + }, + }, }) glamorous.svg({ ':hover': { '& .vendor-class': { height: '10px', - } - } + }, + }, }) export interface StaticProps { visible: boolean } -const StaticWithProps = glamorous.div( - (props) => ({ - display: props.visible ? 'block' : 'none' - }) -) +const StaticWithProps = glamorous.div(props => ({ + display: props.visible ? 'block' : 'none', +})) -const useStatic = ( - -) +const useStatic = // Properties Array glamorous.div({ - overflowWrap: "break-word", - display: ["flex", "block"], -}); + overflowWrap: 'break-word', + display: ['flex', 'block'], +}) glamorous.circle({ - textAlign: "center", - display: ["marker", "block"], -}); + textAlign: 'center', + display: ['marker', 'block'], +}) // pseudo and complex Properties glamorous.div({ ':active': { - "fontSize": 10, + fontSize: 10, }, '&:active': { - "fontSize": 20, - "textAlign": "center", + fontSize: 20, + textAlign: 'center', }, -}); +}) // classname string style const Classname = glamorous.div( { - "fontSize": 20, - "textAlign": "center", + fontSize: 20, + textAlign: 'center', }, 'example', -); +) // StyleFunction -const StyleFunction = glamorous.h1<{ color: string }>( +const StyleFunction = glamorous.h1<{color: string}>( { - "fontSize": "10px", - "zIndex": "auto", + fontSize: '10px', + zIndex: 'auto', }, 'example', - (props) => ({ - "color": props.color, + props => ({ + color: props.color, }), -); +) // withComponent -const ExampleWithComponent = Classname - .withComponent('p') +const ExampleWithComponent = Classname.withComponent('p') -const OtherExampleWithComponent = StyleFunction - .withComponent('p') +const OtherExampleWithComponent = StyleFunction.withComponent('p') const UseWithComponent = () => ( - - + ) - -const StyleFunctionUseColor = () => ( - -) +const StyleFunctionUseColor = () => // StyleFunction Array return -const StyleFunctionArray = glamorous.h1<{ color: string }>( - (props) => [ - 'example', - { - "color": props.color, - } - ], -); +const StyleFunctionArray = glamorous.h1<{color: string}>(props => [ + 'example', + { + color: props.color, + }, +]) // Style Array -const StyleArray = glamorous.h1<{ color: string }>( - [ +const StyleArray = glamorous.h1<{color: string}>([ + 'example', + props => [ 'example', - (props) => [ - 'example', - { - "color": props.color, - } - ], - ] -); + { + color: props.color, + }, + ], +]) // theme styles const Divider = glamorous.span<{ - theme: { main: { color: string; } } + theme: {main: {color: string}} }>( { - "fontSize": "10px", - "zIndex": "auto" + fontSize: '10px', + zIndex: 'auto', }, ({theme}) => ({ - "color": theme.main && theme.main.color, + color: theme.main && theme.main.color, }), -); +) // n-number of styles const SpanDivider = glamorous.span<{ - theme: { awesome: string, main: string } + theme: {awesome: string; main: string} }>( { - "fontSize": "10px", + fontSize: '10px', }, ({theme}) => ({ - "color": theme.awesome, + color: theme.awesome, }), { - "fontWeight": 500, + fontWeight: 500, }, { - "fontFamily": "Roboto", - "fontWeight": 500, + fontFamily: 'Roboto', + fontWeight: 500, }, ({theme}) => ({ - "color": theme.main, + color: theme.main, }), -); +) interface DividerInsideDividerProps { - color: string; -}; + color: string +} // component styles const DividerInsideDivider = glamorous(Divider)<{ visible: boolean -}>( - ({visible}) => ({ - display: visible ? 'block' : 'none', - }) -); +}>(({visible}) => ({ + display: visible ? 'block' : 'none', +})) const DividerInsideDividerWithTheme = glamorous(Divider)<{ visible: boolean - theme: { main: { color: string } } + theme: {main: {color: string}} }>( { - "fontSize": "10px", + fontSize: '10px', }, ({visible, theme}) => ({ display: visible ? 'block' : 'none', - "color": theme.main.color, + color: theme.main.color, }), -); +) const theme = { - "main": { - "color": "red", + main: { + color: 'red', }, -}; +} export const Balloon = () => ( - + Static - - Hello - + Hello -); +) export class AirBalloon extends React.Component<{}, {}> { - private spanElem: HTMLSpanElement; + private spanElem: HTMLSpanElement public render() { return ( { this.spanElem = c; }} + innerRef={(c: HTMLSpanElement) => { + this.spanElem = c + }} > Hello - - Span Divider - + Span Divider - ); + ) } } class Test extends React.Component { private div: HTMLDivElement render() { - return
{ this.div = c }} /> + return ( +
{ + this.div = c + }} + /> + ) } } @@ -275,12 +261,7 @@ class ClassToWrap extends React.Component { const WrappedClass = glamorous(ClassToWrap)({}) -const useWrappedClass = ( - -) +const useWrappedClass = // React Stateless Wrapped Component @@ -290,20 +271,16 @@ export interface WrappedStatelessProps { } } -const StatelessToWrap: React.StatelessComponent = () => ( -
-) +const StatelessToWrap: React.StatelessComponent = () =>
const WrappedStateless = glamorous(StatelessToWrap)( - (props) => ({ - display: props.theme.visible ? 'block' : 'none' - }) + props => ({ + display: props.theme.visible ? 'block' : 'none', + }), ) // Exported Component (for testing declaration generation) -export const ExportTest = glamorous.div( - {} -) +export const ExportTest = glamorous.div({}) // Theme Provider @@ -312,32 +289,33 @@ interface ExampleTheme { } const exampleTheme: ExampleTheme = { - color: "red", + color: 'red', } -const ThemedComponent = glamorous.h1< - { theme: ExampleTheme } ->({ - fontSize: '10px' -}, ({theme}) => ({ - color: theme ? theme.color : 'blue' -})) +const ThemedComponent = glamorous.h1<{theme: ExampleTheme}>( + { + fontSize: '10px', + }, + ({theme}) => ({ + color: theme ? theme.color : 'blue', + }), +) export const ThemeProviderAndThemedComponent = () => ( -); +) // Glamorous component using general prop const props: GlamorousComponentProps> = { name: 'button', - onClick: () => {} + onClick: () => {}, } const GlamorousButton = glamorous.button({ - fontSize: '10px' + fontSize: '10px', }) const UseGlamorousButtonWithGlamorousComponentProps = ( @@ -355,31 +333,24 @@ interface Props { theme: ExampleTheme } -const ComponentWithTheme: React.SFC = (props) => ( -

+const ComponentWithTheme: React.SFC = props => ( +

{props.title}

) -const NonGlamorousThemedComponent = withTheme< - Props ->(ComponentWithTheme) - +const NonGlamorousThemedComponent = withTheme(ComponentWithTheme) -const NonGlamorousAlsoThemedComponent = withTheme< - Props ->(ComponentWithTheme) +const NonGlamorousAlsoThemedComponent = withTheme(ComponentWithTheme) const UseNonGlamorousThemedComponent = (
- - + +
) @@ -387,12 +358,9 @@ const UseNonGlamorousThemedComponent = ( const TestDisplayName: React.SFC = () =>
-glamorous( - TestDisplayName, - { - displayName: 'example' - }, -) +glamorous(TestDisplayName, { + displayName: 'example', +}) // custom glamorous component factory @@ -402,40 +370,32 @@ interface ExampleComponentProps { const ExampleComponent: React.SFC = () =>
-const StyledExampleComponent = glamorous(ExampleComponent)( - (props) => ({ - display: props.visible ? 'none' : 'block' - }) -) +const StyledExampleComponent = glamorous(ExampleComponent)(props => ({ + display: props.visible ? 'none' : 'block', +})) -const StyledExampleComponentHTMLKey = glamorous<{ visible: boolean }>('div')( - (props) => ({ - display: props.visible ? 'none' : 'block' - }) +const StyledExampleComponentHTMLKey = glamorous<{visible: boolean}>('div')( + props => ({ + display: props.visible ? 'none' : 'block', + }), ) -const StyledExampleComponentSVGKey = glamorous<{ visible: boolean }>('circle')( +const StyledExampleComponentSVGKey = glamorous<{visible: boolean}>('circle')( { fill: 'black', }, - (props) => ({ - display: props.visible ? 'none' : 'block' - }) + props => ({ + display: props.visible ? 'none' : 'block', + }), ) -glamorous('circle')({ allowReorder: 'yes' }) -glamorous('div')({ color: 'red' }) +glamorous('circle')({allowReorder: 'yes'}) +glamorous('div')({color: 'red'}) const usingStyledExampleComponent = (
- - + +
@@ -447,7 +407,9 @@ interface ShouldClassNameUpdateProps { color: string } -const TestShouldClassNameUpdate: React.SFC = () =>
+const TestShouldClassNameUpdate: React.SFC = () => ( +
+) const pureDivFactory = glamorous(TestShouldClassNameUpdate, { shouldClassNameUpdate: (props, previousProps, context, previousContext) => { @@ -458,12 +420,14 @@ const pureDivFactory = glamorous(TestShouldClassNameUpdate, { }, }) - interface ShouldClassNameUpdateContext { color: string } -const pureDivFactory2 = glamorous(TestShouldClassNameUpdate, { +const pureDivFactory2 = glamorous< + ShouldClassNameUpdateProps, + ShouldClassNameUpdateContext +>(TestShouldClassNameUpdate, { shouldClassNameUpdate: (props, previousProps, context, previousContext) => { if (context.color !== previousContext.color) { return false @@ -478,25 +442,21 @@ const PureDiv = pureDivFactory({marginLeft: 1}) // withProps const WithPropsDiv = glamorous('div', { - withProps: {primaryColor: 'red'} -})( - (props) => ({ - color: props.primaryColor - }) -) + withProps: {primaryColor: 'red'}, +})(props => ({ + color: props.primaryColor, +})) const SimpleComponent = () =>
const WithPropsSimpleComponent = glamorous(SimpleComponent, { - withProps: {primaryColor: 'red'} -})( - (props) => ({ - color: props.primaryColor - }) -) + withProps: {primaryColor: 'red'}, +})(props => ({ + color: props.primaryColor, +})) const MethodWithPropsComponent = glamorous(SimpleComponent)({}).withProps({ - primaryColor: 'red' + primaryColor: 'red', }) const useWithProps = ( @@ -512,7 +472,9 @@ const useWithProps = ( // propsAreCssOverrides -const ComponentPropsAreCssOverides = glamorous(SimpleComponent, {propsAreCssOverrides: true})({ +const ComponentPropsAreCssOverides = glamorous(SimpleComponent, { + propsAreCssOverrides: true, +})({ margin: 1, fontSize: 1, }) @@ -522,19 +484,14 @@ const DivPropsAreCssOverides = glamorous('div', {propsAreCssOverrides: true})({ fontSize: 1, }) - const usePropsAreCssOverrides = (
- - + +
) -import { Span, Div } from "../" +import {Span, Div} from '../' const testDiv: React.ReactNode = (
@@ -542,39 +499,42 @@ const testDiv: React.ReactNode = (
) -const BuiltinSingleElement: JSX.Element = {}} />; -const BuiltinSingleElementNamedExport: JSX.Element = {}} />; +const BuiltinSingleElement: JSX.Element = ( + {}} /> +) +const BuiltinSingleElementNamedExport: JSX.Element = ( + {}} /> +) const BuiltinSingleChild: JSX.Element = ( Hello, world! -); +) const BuiltinMultipleChild: JSX.Element = ( Hello, world! -); +) -const BuiltinStyledSingleElement: JSX.Element = - +const BuiltinStyledSingleElement: JSX.Element = const BuiltinStyledWithSingleChild: JSX.Element = ( - + Hello, world! -); +) const BuiltinStyledWithMultipleChild: JSX.Element = ( - {}}> + {}}> Hello, world! -); +) -const CustomStatelessComponent: React.SFC<{}> = (_props) =>
+const CustomStatelessComponent: React.SFC<{}> = _props =>
class CustomClassComponent extends React.Component<{}, {}> { render() { return null @@ -594,44 +554,44 @@ const BuiltinStyledComponentChildren: JSX.Element = ( ) const BuiltinStyledWithPrimitivesChildren: JSX.Element = ( - + {null} {false} {true} {undefined} {5} -); +) const BuiltinStyledWithFragment: JSX.Element = (
- {}}> + {}}> - {}}> + {}}>
-); +) const cssProps = { - ":active": { - color: "purple" + ':active': { + color: 'purple', }, -}; +} const BuiltinStyledWithCSSPseudoProps = (
-); +) const nestedCssProps = [ - { color: 'red', }, - () => ({ fontSize: 123 }), - () => () => () => [{ border: '1px solid black'}], -]; + {color: 'red'}, + () => ({fontSize: 123}), + () => () => () => [{border: '1px solid black'}], +] const NestedStyleFunctions = (
diff --git a/typings/css-properties.d.ts b/typings/css-properties.d.ts index 02a5d27f..aca59231 100644 --- a/typings/css-properties.d.ts +++ b/typings/css-properties.d.ts @@ -893,6 +893,11 @@ export interface CSSPropertiesCompleteSingle { | 800 | 900 + /** + * Shorthand property that sets the grid-template-rows, grid-template-columns, grid-template-areas, grid-auto-rows, grid-auto-columns, and grid-auto-flow. + */ + grid?: CSSWideKeyword | string + /** * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. */ @@ -931,6 +936,11 @@ export interface CSSPropertiesCompleteSingle { gridRowSpan?: CSSWideKeyword | number + /** + * Shorthand property that sets the grid-template-rows, grid-template-columns, and grid-template-areas. + */ + gridTemplate?: CSSWideKeyword | string + /** * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. */