How to separate Apostrophe syles from the front end template

痴心易碎 提交于 2019-12-11 17:01:46

问题


I keep running into the conflicts between the front end CSS styles and Apostrophe's own. For example, after i added the template Apostrophe form input fields are now shown in all capitals and alignment is all off. Is there a recommended way to separate them into different scopes? Thanks in advance.


回答1:


This is a very common issue to CMSes, not only to Apostrophe. Personally, I've developed a habit of limiting the scope of all my CSS and JS files to that of the modules they refer to and since then I've never had any single issue with it.

I.e. I have a module called widget and I wrap it in an element that has class 'widget'. This allows me to scope my css only to that '.widget'. Luckily using BEM and less makes scoping a walk in the park.



来源:https://stackoverflow.com/questions/46313346/how-to-separate-apostrophe-syles-from-the-front-end-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!