eqcss / eqcss

EQCSS is a CSS Reprocessor that introduces Element Queries, Scoped CSS, a Parent selector, and responsive JavaScript to all browsers IE8 and up

Home Page:https://elementqueries.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having had time using the @element in an extenal css, it only works in the <style> section

karimlo opened this issue · comments

Hi,
I am not sure why the scrip is not working when trying to use an external css file.
It works fine on the html when used in the <style> section, but I placed the same code in a css file
and referenced it, but nothing is happening.
What am I doing wrong?
I am using this reference from the html header
<link href="css/test-eq.css" rel="stylesheet"/>

Hi @karimlo! The EQCSS plugin is designed that it would try to read any CSS stylesheet added to an HTML document via <link> or <style>. Unfortunately In order to read the file contents of a file added via <link> with a JavaScript plugin means JavaScript has to make a request for the file - it could be the the browser might be able to load your CSS files, but JavaScript may not have permission to request and read the same file (due to CORS security settings). If you check your browser's JS console does it show any errors related to JavaScript not being allowed to read the file?

Another way you can add EQCSS-using stylesheets is with <script type=text/eqcss> inline, or <script type=text/eqcss src=""> with a link to an external stylesheet…but if the problem is a CORS security issue the result might be the same.

Is this site online, or somewhere I could take a look? Being able to see what's happening might help troubleshoot this. But you're right to expect this to work - I don't see anything wrong in the code you have posted!

Yes, thanks. We figured it was the CORS sec. setting. Once I created a virtual directory and opened in my localhost it worked. Now, I have a bigger issue :) I am trying to compile the little code in my *.scss file, but the build is breaking. My SASS compiler doesn't like the "@element". What am I missing?
Thanks