From the suggested best practice to shorten page loading time. One
should place the CSS files at the head of the HTML page, while
Javascript files at the bottom of the page.
With this situation the embedded styles in the RightJS's UI component
actually override the styles that I defined at the CSS files loaded at
the top of the page.
For example, I try to increase the "gap" between the tabs generated by
the Tab module. I try to set .rui-tabs-tab to have a margin-right of
1em but got override by the default 0.1em value.
Is there any solution to solve this situation?
--
You received this message because you are subscribed to the Google Groups "RightJS" group.
To post to this group, send email to rig...@googlegroups.com.
To unsubscribe from this group, send email to rightjs+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rightjs?hl=en.
Presentation is separated from the logic
here is the presentation
https://github.com/rightjs/rightjs-ui/blob/master/src/tabs/tabs.css
here is the logic
https://github.com/rightjs/rightjs-ui/blob/master/src/tabs/tabs.js
What's in the final build doesn't matter.
But embedding styles into javascript has several advantages
- it reduces the number of server requests
- it compresses better by server side gzip
- it is simplifies the installation process
if you want to override the default styles, just place your own styles after the javascript.
if you particularly don't like it, open up the js file and remove the last line of code. it's a second of work
--
Cheers,
Nik
--
Nikolay V. Nemshilov
The Web-Developer
yup, it's not that widely used, probably because it might get tricky in some cases.
but still, i think there are more advantages in this approach than disadvantages. besides a fallback solution is really simple