Can you use the CSS @import directive without an absolute path?

I have some CSS I'd like to have available to the dashboard.

From a user experience I'd like to just upload myCSS.css to files and instruct the user to paste in @import "myCSS.css" to their dashboard CSS. Very easy to maintain by keeping it separate. It would have the additional advantage of only needing one myCSS.css file per hub instead of being loaded into every dash CSS. So the advantages are considerable.

I've tried:
@import "myCSS.css"
@import "./myCSS.css"
@import "./local/myCSS.css"
Which don't work.

This does work but because it's an absolute path to a local file it would not work without a VPN.
@import "http://192.168.0.201/local/myCSS.css"

If this is not already doable then please consider this to be a feature request.

While I would like the same outcome, and I could be wrong about this, but I suspect this could be problematic to implement for two reasons:

  • The dashboard is the output of an app, so the relative path would likely be the location of the application on the hub, something we do not have access to, though I suspect there may be some magic that could be weaved to get around this
  • There is also the situation of users accessing the dashboard through the cloud, which I believe is served up via an Amazon AWS hosted platform. Not sure what the options may be here to keep a CSS file there as well as on the hub....

Like I said, I too would like this option for my own creations, just not sure how it may work in practice.

I would say there are some people interested but not sure that it would be a large number. There was a discussion on here maybe 1-2 years ago from memory, so you may want to look that up, only to gauge the level of interest and any other info that may be useful.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.