I am getting this error:
Mixed Content: The page at 'https://theculprit.com/url' was loaded over HTTPS, but requested an insecure font 'http://fonts.gstatic.com/s/opensans/v10/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf'. This request has been blocked; the content must be served over HTTPS.
When I looked through the source to find where the font was being imported via HTTP rather than HTTPS, the only line pertaining to a font import was:
@import url('//fonts.googleapis.com/css?family=Open+Sans:400,700,300,600,800');
Initially I though HTTPS assets loading over HTTP could be my error, but the font is already being imported using the sources protocol. This only happens after the code has been minified.
I'm not very familiar with fonts/css/less, so I'm completely lost. If there is any other info I can give to help out let me know.
The @import directive is used to import the files in the code. It spreads the LESS code over different files and allows to maintain the structure of code easily. You can put the @import statements anywhere in the code. For instance, you can import the file by using @import keyword as @import "file_name. less".
Yes, always use @import and external Cascading Style Sheets in your Website! CSS does NOT need to be compressed, minimized, preprocessed, etc. And CSS download size, or multiple external CSS files using @import is NOT a problem on the Web.
The @import rule allows you to import a style sheet into another style sheet. The @import rule must be at the top of the document (but after any @charset declaration). The @import rule also supports media queries, so you can allow the import to be media-dependent.
The @import CSS at-rule is used to import style rules from other stylesheets.
Turns out the minifier I am using automatically turns an import starting with //myurl
to http://myurl
and that was causing my issue. I added the processImport: false
option and now everything is working as intended.
An issue has been opened regarding this behavior on GitHub.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With