oncss 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +4 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oncss",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A CSS framework for modern web development.",
5
5
  "main": "./index.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -260,10 +260,9 @@ const App = () => (
260
260
  // Render the component to a string
261
261
  const html = ReactDOMServer.renderToString(<App />);
262
262
 
263
- // Extract the generated CSS from CSSFactory
264
- const styles = Array.from(CSSFactory.values())
265
- .map(style => style.css)
266
- .join('\n');
263
+ let styles: any = Array.from(CSSFactory.values()).map((style) => {
264
+ return `<style data-oncss="${style.classname}">${style.css}</style>`
265
+ });
267
266
 
268
267
  // Inject the styles into the HTML
269
268
  const fullHtml = `
@@ -273,7 +272,7 @@ const fullHtml = `
273
272
  <meta charset="UTF-8">
274
273
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
275
274
  <title>SSR with oncss</title>
276
- <style>${styles}</style>
275
+ ${styles}
277
276
  </head>
278
277
  <body>
279
278
  <div id="root">${html}</div>