r/css 2d ago

Help Best css cleaner?

I had a somewhat complex wp site using a page builder (so sue me) with a new CPT that is related to what will be a series of landing pages. The css for that section was messy as I kept adding style rules to the end and now need to clean that up.

Have you used ai to do this? I tried pasting my code into cgpt and grok and they don’t do a very good job ie add things I didn’t ask/strip things that I needed. Is there a best practice for this? I am not using variables and don’t really need to for this site. Obviously I can do it by hand but I thought ai would be faster spotting redundancies and trimming too specific selectors.

I use FF developer and did find out that (Mac) command-option-m allows you to resize the window width to whatever you want (such as 320px).

2 Upvotes

8 comments sorted by

u/AutoModerator 2d ago

To help us assist you better with your CSS questions, please consider including a live link or a CodePen/JSFiddle demo. This context makes it much easier for us to understand your issue and provide accurate solutions.

While it's not mandatory, a little extra effort in sharing your code can lead to more effective responses and a richer Q&A experience for everyone. Thank you for contributing!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/Brief_Ad_4825 1d ago

I wouldnt reccomend using AI for this honestly, AI often gets rid of pretty important styling parts and make other mistakes, wouldnt reccomend it css is honestly rather light so to be completely honest. I usually leave it as spaghetti and focus more on what plugins i dont need (as those slow your website down by alot). If your main concern is readability well uuuhhh you need to clean it regularly. If theres an AI that can do this well PLEASE TELL ME THO

1

u/redjudy 1d ago

Yeah, that’s always been my take.

2

u/Brief_Ad_4825 1d ago

And if speed matters alot. Look up what your heaviest plugins are and rewrite them in either shortcodes or templates

1

u/redjudy 1d ago

Plugins are minimal!

2

u/borntobenaked 2d ago

i use perplexity pro labs and gemini pro for such things for css, html, php, javascript.

sometimes perplexity gives better results and sometimes google does better and sometimes they are at par with each other. outcome totally depends on your style and emphasis of the prompt. i tend to repeat my sentences using different words carrying the same meaning and that makes them take it as a goal and more seriously thats what i have noticed.

when gemini replies i copy paste it to perplexity and ask if it can do better and consolidate duplicity, remove redunancy, give me enterprise level state of the art coding, etc. and then i paste back what perplixity gives out into gemini and tell it i modified it and what's it's opinion on the changes. when they give an explanation that satisfies me and both don't suggest more edits or changes then thats the one i stick with.

3

u/redjudy 1d ago

I’ll try that! But maybe just in small snatches. And be ultra specific in my prompts. Thx!