1

In a Derby.js app, I am trying to install skeleton through bower and include it in all derby apps. I know how to include styles within a single app, but can they be registered to all apps at once?

For instance if I had the following apps:

+ apps
   - login 
   - myApp
   - error

How could I add the required stylesheets to all apps, without having to explicitly call app.loadStyles(...) in each one?

BenM
  • 553
  • 1
  • 6
  • 23

1 Answers1

1

Each app will need to call loadStyles. Derby bundles up apps individually and only serves up that bundle when using that app.

You can bypass derby's style loading and just reference your global styles like you might do any other 3rd party style sheet in the element of your html. You can accomplish this with a shared view but it wont be less typing.

What is the motivation? Avoiding more boiler plate?

enjalot
  • 660
  • 3
  • 7
  • Motivation was that separation of concerns is not necessarily a separation of styling. Fonts/forms/etc. would all still be styled the same regardless of if they are for login or the main app. Calling each on its own works though, was just trying to avoid it. Thanks! – BenM Apr 01 '15 at 18:48
  • I ended up just calling `app.loadStyles(file)` when the apps are getting bundled. So still calling `loadStyles` one at a time, but doing it in one place at least. – BenM Apr 01 '15 at 19:28