For example, is it possible to do something like:
<style type="text/less"> #foo { .bar { font-weight: bold; } } </style>
One of the main reasons that inline styling is not a good choice for your application is because it does not support (or it has really poor support) for CSS features. Every application nowadays might have to end up using some selectors such as :hover , :active , :focused , etc.
Inline styles, while they have a purpose, generally are not the best way to maintain your website. They go against every one of the best practices: Inline styles don't separate content from design: Inline styles are exactly the same as embedded font and other clunky design tags that modern developers rail against.
Yes, inline styles are technically faster than an external stylesheet because you are making one less request on top of the page but using an external stylesheet is much preferred for code maintainability.
Disadvantages of Inline CSS These styles cannot be reused anywhere else. These styles are tough to be edited because they are not stored at a single place. It is not possible to style pseudo-codes and pseudo-classes with inline CSS. Inline CSS does not provide browser cache advantages.
You actually need to use
<style type="text/less">
instead of:
<style type="stylesheet/less">
Otherwise it won't work.
Remember to place the <style>
element before the <script>
element to load less.js.
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