Theming : How do i exclude incompatible code that is added?
Created 7 years ago by william

The Switch plugin is depended on old less not compatible with newer bootstrap versions. If i don't want that addon to add that old less code for theming, what do i do? Do i override all the views that includes it?

I would like a discussion in the community regarding this. In my mind, field types should not be allowed to include styling that is depended on frameworks. In the case of this less file, the author of the plugin should hard code the color and border radius values in the stylesheets, with the !default making it possible to override.

In this case, when trying to develop an admin theme that uses a newer version things break. Another issue is that those variables would not be accessible by the field type if you would compile the theme stylesheets with webpack/gulp and add the final css file in with assetics.

To me, this is bad practice that cause issues and we should make sure we avoid it as developers.

ryanthompson  —  7 years ago

Let's just replace it.

william  —  7 years ago

Replace what? How?

ryanthompson  —  7 years ago

Replace the field type JS with CSS-only lol - we're on the same page now. When you can't fix. Improve.

fryiee  —  7 years ago

I don't think there's a problem with using other libs as part of FTs - we just need to make sure all dependencies are bundled with the FT so it is modular enough to plug and play.