Importing modular css into custom widget

84
2
Friday
DanielWebb
Frequent Contributor

In the ongoing saga of learning React and TypeScript while simultaneously troubleshooting the different versions of developer edition, I have a question.

In Experience Builder Developer Edition 1.11 I was able to import modular css.

import styles from "./my-styles.module.css";

Pretty basic stuff, I thought.

But when I try in ExB edition 1.16, styles is undefined?

Am I missing something obvious? Does developer edition no longer import modular css?

Thanks!

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

The current documentation shows a simpler import

import 'path/to/style.css';

 

0 Kudos
DanielWebb
Frequent Contributor

I was able to get that to work but that imports css for the whole site, and so good naming conventions are more necessary to make sure there's no conflict with other stylings. Modular css is nice because it's contained and I can still use things like element.classList.remove(), and things like that.

0 Kudos