简体   繁体   English

在Derby.js中包括跨应用程序的样式

[英]Including Styles Across Apps in Derby.js

In a Derby.js app, I am trying to install skeleton through bower and include it in all derby apps. 在Derby.js应用程序中,我试图通过Bower安装骨架并将其包含在所有derby应用程序中。 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? 如何在所有应用程序中添加必需的样式表,而不必在每个应用程序中显式调用app.loadStyles(...)

Each app will need to call loadStyles. 每个应用都需要调用loadStyles。 Derby bundles up apps individually and only serves up that bundle when using that app. Derby会分别捆绑应用程序,并且仅在使用该应用程序时提供该捆绑软件。

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. 您可以绕过derby的样式加载,而仅引用全局样式,就像您可以在html元素中进行任何其他第三方样式表一样。 You can accomplish this with a shared view but it wont be less typing. 您可以使用共享视图来完成此操作,但不会减少键入的次数。

What is the motivation? 动机是什么? Avoiding more boiler plate? 避免更多的锅炉板?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM