# Option to minify css selector names

**URL:** <https://zola.discourse.group/t/option-to-minify-css-selector-names/1992>\
**Category:** Feature requests\
**Created:** [December 31, 2023, 4:05pm UTC](https://zola.discourse.group/t/option-to-minify-css-selector-names/1992 "2023-12-31T16:05:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![myrrc](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/myrrc/32/1155_2.png) [@myrrc](https://zola.discourse.group/u/myrrc)\
**Post date:** [December 31, 2023, 4:05pm UTC](https://zola.discourse.group/t/option-to-minify-css-selector-names/1992/1 "2023-12-31T16:05:01Z")

</div>

This is mostly related to code highlighting, but can be generalized to all code.  
For example, in Jekyll the code highlighting css has selectors like  
`.ha, .hb`. In Zola they’re more verbose (`z-function-call`), and this implies bigger page size (I measured a 50+kb overhead for one of my articles).

The suggestion is to add an option which would

1. Scan html templates to get classes and ids.
2. Scan Sass/SCSS files to get classes, ids, and variables.
3. Replace the selectors with minified auto-generated names.

---

<div class="post-metadata">

**Author:** ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)\
**Post date:** [December 31, 2023, 5:14pm UTC](https://zola.discourse.group/t/option-to-minify-css-selector-names/1992/2 "2023-12-31T17:14:38Z")

</div>

That’s not going to be an issue anymore after [Investigate tree-sitter to replace syntect · Issue #1787 · getzola/zola · GitHub](https://github.com/getzola/zola/issues/1787) so I wouldn’t bother implement anything.  
The issue above is blocked on tree-sitter releasing a version with support for pre-compiled things which is in the roadmap. The actual highlighter code is already mostly written. If it takes too long we might use a fork but we’re not in a hurry
