0

I am using module.scss in next.js for styling.

import styles from './test.module.scss';

export default function Test() {
  return (
    <>
          <div className={styles.wrapper}></div>
          <div className="aaaa">asdsa</div>
    </>
  );
}
// test.module.scss


.wrapper {
}


.aaaa {
  background-color: red;
} // It's not working!!!

The class aaaa is applied as a generic variable. How can I style it while referencing the generic class name inside the test.module.scss file?

I want to style while referencing that class name without using child selectors!

pvp11
  • 204
  • 2
  • 10
  • You can use `:global(.aaaa)`. Please, also see [this answer](https://stackoverflow.com/a/40065474/15321956) – lluchkaa May 31 '23 at 08:37
  • What do you mean with generic classname? do you mean the name is provided during runtime as a dynamic parameter? the question is currently unclear. – Martin May 31 '23 at 13:32

0 Answers0