CSS modules theme example
See original GitHub issueHello,
I love this project, it is working great so far.
Just a suggestion on a docs improvement. I like how you can theme it using CSS modules or inline styles etc, but there is no good CSS modules example.
I just converted the basic styles over to a CSS (not a big thing) but think it would be great if you provided a basic example using CSS modules.
Here is the CSS that I converted from https://codepen.io/moroshko/pen/OpPqxY
.container {
position: relative;
}
.input {
width: 240px;
height: 30px;
padding: 10px 20px;
font-family: Helvetica, sans-serif;
font-weight: 300;
font-size: 16px;
border: 1px solid #aaa;
border-radius: 4px;
}
.inputFocused {
outline: none;
}
.inputOpen {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.suggestionsContainer {
display: none;
}
.suggestionsContainerOpen {
display: block;
position: absolute;
top: 51px;
width: 280px;
border: 1px solid #aaa;
background-color: #fff;
font-family: Helvetica, sans-serif;
font-weight: 300;
font-size: 16px;
border-radius: 0 0 4px 4px;
z-index: 2;
}
.suggestionsList {
margin: 0;
padding: 0;
list-style-type: none;
}
.suggestion {
cursor: pointer;
padding: 10px 20px;
}
.suggestionHighlighted {
background-color: #ddd;
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:5
Top Results From Across the Web
klimashkin/css-modules-theme: Theme composition ... - GitHub
A CSS Module is just a CSS file in which all class names and animation names are transformed on build time to be...
Read more >Themify your (S)CSS Modules | Technology - Lastminute.com
Personalise your application with shiny themes combining CSS Modules and Bootstrap SASS.
Read more >CSS modules | Barbarian Meets Coding
CSS modules are a CSS framework that allows you to write CSS classes and animations that are locally scoped by default and thus...
Read more >change-theme-with-css-modules - CodeSandbox
CodeSandbox is an online editor tailored for web applications.
Read more >A simple React Theme Component using CSS variables
We like to use CSS Modules so the solution should be compatible. ... For example, a small Button component could look like this: ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had to do this to get it working
I had to name the
theme.css
file in the example provided by @stewartduffy as<something>.module.css
in order to get it working. I think it has something to do with thereact-scripts
preprocessing.