Types of CSS modules
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- css, typescript
- Domain
- frontend
Research direction
Start with the reported named import and the existing index.d.ts declaration, then reproduce the Gatsby v3 and TypeScript error described in the issue. Compare the declaration with the CSS module export behavior and determine whether the supported approach needs documentation or a project change; done when the correct declaration pattern is clear and verified.
Written by the indexing model from the issue text.
Description
It's not clear to me how currently should types be declared for CSS modules.
For the context, I'm using Gatsby v3 with TypeScript and an example import would be:
import { Header } from './header.module.css';
However, the old style index.d.ts I had won't be suitable anymore since default exports were replaced with tree-shakeable variables:
declare module '*.module.css' {
const value: { [className: string]: string };
export default value;
}
That pretty much now ends up in this error:
Module '"*.module.css"' has no exported member 'Header'. Did you mean to use 'import Header from "*.module.css"' instead?
I'm not sure how this can be handled in the latest version?
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from madyankin/postcss-modules
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
madyankin/postcss-modules#159 ·
-
Options.getJSON is not executed in a .css file that contains the same styles as another .css file Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
madyankin/postcss-modules#156 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
madyankin/postcss-modules#153 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
madyankin/postcss-modules#150 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
madyankin/postcss-modules#149 · 4 comments · 2 reactions ·
All issues in madyankin/postcss-modules
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·