Skip to content

✨ Minifies and obfuscates the class names in HTML #169

@1aron

Description

@1aron

Description

The HTML generated by Master CSS SSR:

import { renderHTML } from '@master/css'
...
const html = renderHTML(html);
res.set('Content-Type', 'text/html');
res.send(Buffer.from(html));
<html>
<head>
    <style title="master">
        .text\:center { text-align: center }
        .font\:16\:hover:hover { font-size: 1rem }
    </style>
</head>
<body>
    <h1 class="text:center font:16:hover"></h1>
</body>
</html>

Now with minifying:

import { renderHTML, minify } from '@master/css'
...
const html = minify(renderHTML(html));
res.set('Content-Type', 'text/html');
res.send(Buffer.from(html));
<html>
<head>
    <style title="master">
        .a { text-align: center }
        .b:hover { font-size: 1rem }
    </style>
</head>
<body>
    <h1 class="a b"></h1>
</body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    undocumentedNot yet written into official documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions