S
S
Saulin2020-03-13 12:58:42
css
Saulin, 2020-03-13 12:58:42

Any tips on optimizing css code?

I started to master css and simultaneously make a website and I constantly get confused in my css code. As the code grows, it becomes more and more difficult to navigate it, find the right place and fix bugs. Maybe there are some structuring rules or algorithms that make life easier in this regard? Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Usachov, 2020-03-13
@Saulin

As Computius wrote,

In programming, about 30% of the time is spent on actual programming, and the remaining 70% is spent on inventing variable and function names.

The same is true for layout.
The correct approach would be to understand the logic and behavior of the future project, so as not to produce unnecessary entities and prevent their shortage in the future. On the edge, provide easy scaling and adding. Those. you need to provide for everything or create conditions for this.
From the toolkit.
1. It would be nice to switch to BEM from our beloved Yandex.
2. Use css preprocessors like less or sass , which greatly simplifies both reading and editing css.
3. Search engines where you can find the answer to the question.
4. Youtube with specialized lessons.
5. A bright head that can suggest the right decision and approach.
6. A tool like map for your favorite IDE.
7. The IDE itself, which makes life much easier. My favorite options are Brackets, Atom, WebStorm.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question