• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Extraneous CSS rules

Q&A Forum › Category: ESP32 › Extraneous CSS rules
0 Vote Up Vote Down
Ray Leiter asked 3 years ago

I suspect this issue can arise often in large projects.
Often, we begin our css file by borrowing one from a previous project whereupon we try to get rid of any rules not needed in the new project.
If we miss any, they will probably not cause a problem since you can have as many unused rules as you would like in a css file — it works with extra stuff!
Supposing you wish to eliminate all unneeded rules — other than be sharp-eyed, what is the recommended way?
Is there anything like “tidy” (for HTML) that helps us with CSS?

Question Tags: CSS, unneeded rules
3 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
Ray.
I’m sure there is some software that does that with websites.
However, I don’t know how to do that automatically in our local files.
I found this article: https://www.keycdn.com/blog/remove-unused-css
That explains how to detect unused CSS. Then, you can delete it manually.
I hope this helps.
Regards,
Sara

0 Vote Up Vote Down
Ray Leiter answered 3 years ago

Sara;
Thanks. I looked over the reference you provided — some useful stuff there!
What led me to ask the question was the unused CSS in Project 4.3 (WiFi Manager for Web Server) in “Build Web Servers with ESP32 and ESP8266”.
It’s not significant since it’s only one rule, but it sparked my interest, so I thought it best to ask.
The CSS in question has a rule for a class “value” which isn’t used in this project.
I believe the CSS was borrowed from Project 4.1 or 4.2 as opposed to Project 2.1.
As usual, I just can’t get over how good this course is — I’m glad I signed up!
I’m moving right along with my studies:
On this course, I have to do 4.3, 4.4 and 4.5 and then I’m finished. I already did the EXTRA projects.
On the previous course, “Learn ESP32”, I have to do the EXTRA UNITs and then I’m done with that one.
I also purchased the 2 Automation courses — don’t know which one to start first?
Thanks again for all the good work.
Ray

0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

Hi.
If it isn’t used, it was probably a mistake during copy/paste from other projects.
I’m glad that you’re enjoying our eBooks.
I’ll mark this issue as resolved. If you need further help, you just need to open a new question in our forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.