eqcss icon indicating copy to clipboard operation
eqcss copied to clipboard

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

Open karimlo opened this issue 6 years ago • 3 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

karimlo avatar Sep 16 '19 22:09 karimlo

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!

tomhodgins avatar Sep 19 '19 09:09 tomhodgins

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

karimlo avatar Sep 19 '19 21:09 karimlo

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

did you ever find a solution to this? Im facing the same issue.

DirtRIFWeb avatar Mar 20 '24 05:03 DirtRIFWeb