# Optimizing CSS with LLMs

> Source: <https://www.dotnetperls.com/2026_11_20_optimizing-css-llms>
> Published: 2026-11-20 07:00:00+00:00

**Recommendation:** Run bloated inline CSS through an LLM to strip redundant selectors and adopt shorthand before shipping; the source saved 100-200 bytes per page with no visual changes for 0.037 cents.
More in the playbook "Controlling LLM cost": <https://wpnews.pro/playbooks/llm-cost>

I have an **inline style sheet** I use on every page on this site. I use inline CSS as it allows each page to load without a separate download. Over the years this CSS has become **slightly bloated**—I decided to paste the CSS into **Muse Ember** and ask it to find ways to reduce its size.

The LLM responded with a list of suggestions. Some of the selectors were **redundant**; and I was not using some **shorthand syntax**. Some rules were not needed. Overall, I saved 100-200 bytes from each page—with no visual changes.

The total cost (for two prompts) was 0.037 cents. It seems to me that this use of AI was a **clear win**—each page is **faster**, and this will improve my own experience on the site (as well as that of the **bots** that download my pages constantly). I wish people could use AI in a more **limited way**—using a chat bot to minify CSS seems like a good idea; using a chat bot to "write me a blog post" is going to just make the world more annoying.
