Replies: 10 comments
-
Would it not be possible to merge class .c { text-align: center }
.c:hover { font-size: 1rem } now |
Beta Was this translation helpful? Give feedback.
-
Great start! It may be possible, but more complete test cases are needed to confirm whether it will conflict with the current API. |
Beta Was this translation helpful? Give feedback.
-
@ If it would be possible then can you assign me to this issue I want to resolve this would be my first contribution |
Beta Was this translation helpful? Give feedback.
-
Welcome! It's recommended to refer https://github.com/master-co/css/blob/beta/packages/css/src/functions/render-html.ts |
Beta Was this translation helpful? Give feedback.
-
@1aron Thank you so much, Sir for assigning me this issue |
Beta Was this translation helpful? Give feedback.
-
@1aron Sir Is it okay if I request more information, or is there anything else you would like assistance with? I'm here to resolve this issue? import { MasterCSS } from '../core';
import { Config, renderHTML, minify } from '@master/css'; // Import renderHTML and minify
import generateFromHTML from './generate-from-html';
/**
* Renders the page-required and sorted CSS text from HTML and injected it back into HTML
* @param html
* @param config
* @returns html text
*/
export default function renderHTMLWithMinification(html: string, config?: Config): string {
if (!html) return;
let replaced = false;
html = html.replace(
/(<style id="master">).*?(<\/style>)/,
(_, prefix, suffix) => {
replaced = true;
return prefix + generateFromHTML(html, config) + suffix;
}
);
if (replaced) {
return minify(html); // Minify the HTML if styles were replaced
}
const styleText = `<style id="master">${generateFromHTML(html, config)}</style>`;
const minifiedHtml = minify(html.replace(/<\/head>/, `${styleText}$&`));
return minifiedHtml;
}[](URL) |
Beta Was this translation helpful? Give feedback.
-
@1aron Sir Is this your main website? |
Beta Was this translation helpful? Give feedback.
-
@pragyamishra56 I think you misunderstood. |
Beta Was this translation helpful? Give feedback.
-
@1aron Sir, could you please assist me? You mentioned that you want improvement in the section I referred to, correct?" import { renderHTML } from '@master/css' Now with minifying: import { renderHTML, minify } from '@master/css' |
Beta Was this translation helpful? Give feedback.
-
Again, there is currently no |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
The HTML generated by Master CSS SSR:
Now with minifying:
Beta Was this translation helpful? Give feedback.
All reactions