C
C
chelkaz2017-07-06 21:14:19
1C-Bitrix
chelkaz, 2017-07-06 21:14:19

Component styles after main perhaps?

I can't stand it important! When I write projects from scratch, I set the priorities so that important is not needed. But!
The fact is that by default in Bitrix the main file template_styles.cssis connected last.
and the styles of the components are in front of it) This is not logical, and I throw a stone into the garden for the system developers.
Began to leaf through docks, but found nothing. I do not consider it logical to pick the core.
So who can come across? How can I make component styles appear after the main ones?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Burlaka, 2017-07-07
@AlexeyGfi

Styles can be overridden not only with !important , but also with a more extended rule using any parent.
That is, if we have:

<div class= 'parent'>
  <div class= 'child'>
    Текст
  </div>
</div>

And styles:
.child { color: red; }
.parent .child { color: blue; }

Then the color of the text inside .child will be blue instead of red.

A
Artyom Luchnikov, 2017-07-07
@lu4nik

As for me, styles and scripts should not be scattered over the components - then you are tormented to look for and edit them. Put everything in one place. CSS, for example, only write in the same template_styles.css. Then the problem of the task will be solved and you won’t have to look for anything on the project every time you need to correct something.

S
Sergey, 2017-07-07
@gangstarcj

Delete, if it is in the template, this file and that's it.
Take styles from it and add them to yours.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question