You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I simply use style-loader evertything renders properly, but the <style> tag get loaded in the head. Is it possible to set this up so the style gets bundled up inside the shadow-root?
webpack starts and serves my component properly displayed and formated except for the colors and fonts.
Please help :-)
Thanks
The text was updated successfully, but these errors were encountered:
In your top-level React component. The dangerouslySetInnerHTML is the important bit that you may have been missing.
import React from 'react';
import ReactDOM from 'react-dom';
import root from 'react-shadow';
import App from 'containers/App';
// To work within the shadow dom, we need to import the SASS as a string
import stylesheet from './content.styles.scss';
// attach the sidebar to the page body
const app = document.createElement('div');
app.id = 'your-root';
app.className = 'your-root';
document.body.appendChild(app);
ReactDOM.render(
<root.div>
<style dangerouslySetInnerHTML={{ __html: stylesheet }} />
<App />
</root.div>
app
);
Hello,
I'm trying to configure my webpack config to convert my scss files to css and the insert in into my component's shadow-root context.
I'm starting to think it's not possible :-|
Example :
In my component I import my style like this. Currently, it's a style.js file
import { style, colors } from './style';
style
is defined and usable. YEAH!!colors
is defined, butcolorLogoGrey
,colorBrand
andcolorGreyActive
are all undefinedstyle.js
As you can see, I'm trying to import colors from style.scss
I've tried many different combinations with the following webpack configuration:
If I simply use
style-loader
evertything renders properly, but the<style>
tag get loaded in the head. Is it possible to set this up so the style gets bundled up inside the shadow-root?webpack starts and serves my component properly displayed and formated except for the colors and fonts.
Please help :-)
Thanks
The text was updated successfully, but these errors were encountered: