soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

CSS classes weirdness (disconnected duplicates in Oxygen & universal.css) #2238

Open andreasputlitz opened 3 years ago

andreasputlitz commented 3 years ago

When adding new custom selectors or custom stylesheets, Oxygen dumps them into the universal.css file under uploads. (Or at least, I haven't found any other "source of truth", where they are stored.)

When I add a custom selector named .fooand a stylesheet with a class named .foo, in Oxygen they exist completely independently from one another, while in fact, they live in the same file, overriding each other.

Changes made to these classes in the universal.css file, will be used by the browser, but completely ignored by Oxygen - and then overridden the next time you save in Oxygen.

I would like to (1) have classes from "custom stylesheets" and "custom selectors" to integrate with one another, in a sense, that when you add a class named .barthe custom selector .barwill also appear and they are linked to each other.

Also (2), I would like to have the (easy) capability to add/change/remove classes directly in a file on the server, and Oxygen pulling those changes in and making them usable.

The use case is to be able to properly work with CSS classes in a team. In particular, I would like to be able to have our designer create CSS in a separate file, and then include this file into Oxygen, being able to use the classes defined in the file, without the need to manually add each and every class through the UI, without any possibility of making any changes to them later on.

andreasputlitz commented 3 years ago

Ok, more weirdness:

Now, when I add a selector through the "add selectors" menu, this creates yet another "type" of class inside of Oxygen, which is again appended to the universal.css file.

But, this selector is also not selectable through the element class selector dropdown in the upper left corner. When I enter the name of the selector I just created, Oxygen will simply add a yet another selector.

Now I have three instances of a "class" or "selector" with the name .test inside of Oxygen, which are completely disconnected from one another (inside of Oxygen), but which live side by side in the universal.css overriding each other subsequently.

Again, any changes made to any of those classes in the universal.css, will be ignored by Oxygen and overridden on the next "save".

I really love other aspects of oxygen, but this can't be it. Please, please add a proper CSS management.

andreasputlitz commented 3 years ago

A little more research revealed that the custom selectors / classes are in fact stored in the database in the wp_options table, under ct_components_classes. Not sure, if that can be used somehow to "directly" work with them. Renaming and sorting has been an issue as well, as I have seen.

max-got commented 3 years ago

+1