Skip to content

Commit

Permalink
fix(CSS): #127 include nested childs from css module
Browse files Browse the repository at this point in the history
  • Loading branch information
Viijay-Kr committed Feb 2, 2024
1 parent 107f887 commit 96f6d37
Show file tree
Hide file tree
Showing 8 changed files with 248 additions and 130 deletions.
5 changes: 3 additions & 2 deletions examples/jsx-project/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from "react";
import reactLogo from "./assets/react.svg";
import styles from "./scss.module.scss";
import css from './App.module.css';

function App() {
const [count, setCount] = useState(0);
Expand All @@ -16,11 +17,11 @@ function App() {
</a>
</div>
<h1>Vite + React</h1>
<div className={styles['test-child']}>
<div className={styles['nested-child']}>
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<p>
<p className={css.nestedLogo2}>
Edit <code>src/App.jsx</code> and save to test HMR
</p>
</div>
Expand Down
8 changes: 8 additions & 0 deletions examples/jsx-project/src/App.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
padding: 1.5em;
will-change: filter;
transition: filter 300ms;

.nestedLogo {
margin: 1rem;
}

.nestedLogo2 {
display: inline;
}
}

.logo:hover {
Expand Down
32 changes: 0 additions & 32 deletions examples/react-app/src/App.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/react-app/src/App.js.map

This file was deleted.

8 changes: 8 additions & 0 deletions examples/react-app/src/styles/button.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
.btn-primary {
background: #000;
}

.btn-secondary {
background: #0019;

.btn-secondary-nested {
background: cyan;
}
}
Loading

0 comments on commit 96f6d37

Please sign in to comment.