Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

fix: css-module support about 'keyframes logo-spin' #416

Open
wants to merge 2 commits into
base: wm-react-scripts-2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions template/images.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ declare module '*.jpeg'
declare module '*.gif'
declare module '*.bmp'
declare module '*.tiff'

declare module '*.module.css' {
const exports: { [exportName: string]: string };
export = exports;
}
declare module '*.module.scss' {
const exports: { [exportName: string]: string };
export = exports;
}
declare module '*.module.sass' {
const exports: { [exportName: string]: string };
export = exports;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it still reside in images.d.ts? Should it be styles.d.ts

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right.

declare module '*.css'
declare module '*.scss'
declare module '*.sass'
8 changes: 4 additions & 4 deletions template/src/App.css → template/src/App.module.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
:local .app {
.app {
text-align: center;
}

:local .logo {
.logo {
animation: logo-spin infinite 20s linear;
height: 40vmin;
}

:local .header {
.header {
background-color: #282c34;
min-height: 100vh;
display: flex;
Expand All @@ -18,7 +18,7 @@
color: white;
}

:local .link {
.link {
color: #61dafb;
}

Expand Down
2 changes: 1 addition & 1 deletion template/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import * as styles from './App.css';
import * as styles from './App.module.css';
import logo from './logo.svg';

class App extends React.Component {
Expand Down