From e0ad8770226545b6119a6eade1eb5f99b238cb2e Mon Sep 17 00:00:00 2001 From: lbwa Date: Sun, 1 Mar 2020 16:59:04 +0800 Subject: [PATCH] feat(sass): support css module with TS render func --- src/global.d.ts | 20 ++++++++++++++++++++ src/layouts/LMainFooter.module.sass | 11 +++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/layouts/LMainFooter.module.sass diff --git a/src/global.d.ts b/src/global.d.ts index ea4127f..6c90353 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -12,3 +12,23 @@ * Whether we are in development environment */ declare const __DEV__: boolean + +/** + * + * https://github.com/facebook/create-react-app/blob/v3.4.0/packages/react-scripts/lib/react-app.d.ts#L53-L66 + */ + +declare module '*.module.css' { + const classes: { readonly [key: string]: string } + export default classes +} + +declare module '*.module.scss' { + const classes: { readonly [key: string]: string } + export default classes +} + +declare module '*.module.sass' { + const classes: { readonly [key: string]: string } + export default classes +} diff --git a/src/layouts/LMainFooter.module.sass b/src/layouts/LMainFooter.module.sass new file mode 100644 index 0000000..dae9562 --- /dev/null +++ b/src/layouts/LMainFooter.module.sass @@ -0,0 +1,11 @@ +.lmf + &__footer + font-size: 12px + text-align: center + padding: 20px 0 + + &__link + text-decoration: none + + &:hover + text-decoration: underline \ No newline at end of file