Connection style.css in javascript file?

0 like 0 dislike
8 views
Hi!
There is a page index.html and it connects a lot of files (css, js).
How to organize the connection of all the files in one line?
Is it possible to specify all connections in the js file, and instead of a big beard to specify only one line type
?
p.s. This is necessary when a lot of html sites and all you need to attach your styles and settings and is not necessary to copy the beard, put only 1 connection and all. I.e. focus on code quality and the speed of the connection their pre-prepared files.
by | 8 views

2 Answers

0 like 0 dislike
Yes you can,
spoiler
let head = window.document.getElementsByTagName('head')[0] function includeCSS(aFile, aRel){ let style = window.document.createElement('link') style.href = aFile style.rel = aRel || 'stylesheet' head.appendChild(style) }
by
0 like 0 dislike
So there is the option of cooler - collector to collect in a single css file, js to file. And only connect them.
Well, you have all the buns collector: minification, all sorts of prefixes, babel, ...
by

Related questions

0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
32,781 users