Description logic of the color change from the admin. panel OkayCMS 3. *
A new block has appeared in the design settings for customizing colors
These colors are written to a separate file in the template, which is located in design / theme / css / theme-settings.css and looks like this
These are CSS variables, but since browser support for them is still weak, we compiled the CSS files, and wherever the variable was used
in the original file (which remains, nothing happens to it) is replaced by the value of this variable in the compiled file
It is also advisable to use these variables now when developing modules so that the modules immediately fit into the style of the site.
Registration of CSS and JS files has been done. To do this, you need to register them in design / theme / js.php and design / theme / css.php in this form
You need to return an array of objects of type Okay \ Core \ TemplateConfig \ Js or Okay \ Core \ TemplateConfig \ Css.
We tried to describe these classes in as much detail as possible.
Now you don't need to write a lot of CSS and JS files in HTML. All registered files will be compiled into one output file (which is minified), unless otherwise specified in the parameters. They will connect like this:
Inside the file will contain all the files included in it in the same order as their registration.
Cache files are sensitive to changes to their original files, i.e. if you change the original file, then the cache will be updated automatically.
Now only external resources need to be connected via <script> or <link>.
If you need to include some script or style file by condition, for example, "share" in the product card and blog. You need to use Smarty plugins {js} and {css} with the following parameters:
file or filename is the name of the file,
dir - path to the script folder relative to the site root,
defer - whether the defer attribute is needed (applies only to the js plugin)