Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand correctly and you're concerned about (what essentially amounts too) conflicts with the CSS, then including your own custom stylesheets <em>after</em> the library ones is the best starting point; as @rthor has pointed out.</p> <p>However this may not solve every issue, purely because it also depends on the specificity of the CSS selectors. There's a good article here on <a href="http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/" rel="nofollow">CSS specificity</a> - which should also enable you to effectively combat any CSS conflicts that arise.</p> <p>Now scope? That's a different subject, and one that's a little more confusing - purely because of (<em>surprise surprise</em>) browser implementations differ. You can just a polyfill for older browsers but that's not great. <a href="http://css-tricks.com/saving-the-day-with-scoped-css/" rel="nofollow">It's purely a HTML5 feature it seems</a> <a href="http://www.w3.org/TR/selectors4/#scope-pseudo" rel="nofollow">Unless you're talking about the :scope psuedo-selector.. which is working draft for <em>CSS Selectors 4</em></a></p> <p>I'm sure some front-end wiz will be able to give you low down specifically regarding scope, as I expect my solution leaves a little bit to be desired. You could always make use of container elements (<em>gasp.. I know, not ideal.</em>) and ensure all styles specifically target children of the a container element.</p> <p>Essentially..</p> <pre><code>&lt;div id="widgetA" class="scope"&gt; &lt;!-- So this is our 'scope' --&gt; &lt;div id="bla bla"&gt;.....&lt;/div&gt; &lt;/div&gt; </code></pre> <p>By ensuring all your CSS selectors begin with the container element:</p> <pre><code>div#widgetA{ /* We essentially get a scoped namespace */ } </code></pre> <p>However that comes with nasties such as non-semantic mark-up and <em>overly specific</em> selectors which are bad for performance. However, it has legacy support and is quick'n'easy.. albeit a bit of a hack. <strong>If you use something like Sass/Less you could even quickly wrap the whole libraries CSS file in a <code>div.widget{ }</code> rule and compile it; giving scope (<em>albeit with the above drawbacks</em>).</strong></p> <p>Alternatively, from a javascript view - if you target specific elements (and only those elements), I can't see too many issues arising from libraries applying their own styling - as the libraries shouldn't really be tampering with other elements.</p> <p>Good luck</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload