简体   繁体   English

弹性皮肤或风格?

[英]flex skins or style?

I made a research, but I didn't find anything to helps me answer this question我做了一个研究,但我没有找到任何可以帮助我回答这个问题的东西

When you have a flex project, is it better to use different skins for different components or to use just one big css that has all the styles together?当你有一个 flex 项目时,是为不同的组件使用不同的皮肤,还是只使用一个大的 css 将所有 styles 放在一起更好?

It is not very clear from the question are you talking about standard components and their custom skins/styles or you're talking about custom components and ways to design them to be customizable?问题不是很清楚,您是在谈论标准组件及其自定义外观/样式,还是在谈论自定义组件以及将它们设计为可定制的方法?

Anyway I'll try to answer.无论如何,我会尽力回答。 Spark architecture isn't reject styles and using CSS for component's customization. Spark 架构不拒绝 styles 并使用 CSS 进行组件定制。 All the standard components support styles and have out-of-the-box skins which support them.所有标准组件都支持 styles 并具有支持它们的开箱即用皮肤。 So if you're using standard components with standard skins and it fits your requirements it is better to use available styles for additional customization.因此,如果您使用带有标准皮肤的标准组件并且它符合您的要求,最好使用可用的 styles 进行额外定制。

If standard skins of standard components don't fit your needs you have to decide which strategy to choose:如果标准组件的标准外观不符合您的需求,您必须决定选择哪种策略:

  1. Create skins which support additional customization with CSS.使用 CSS 创建支持额外自定义的皮肤。 You can choose this option if you're creating some skins for external use (for some other developers or teams).如果您正在创建一些外部使用的皮肤(对于其他一些开发人员或团队),您可以选择此选项。 It gives them possibility to use your skins without modification and with additional customization.它使他们可以在不修改和额外定制的情况下使用您的皮肤。 If you're creating custom components for sale or for a client you also should choose this strategy.如果您正在为销售或为客户创建自定义组件,您也应该选择此策略。
  2. Create skins without additional customization possibilities (all the values such as colors, icons, fills, strokes, fonts are hardcoded).创建无需额外自定义可能性的皮肤(所有值,例如 colors、图标、填充、笔划、fonts 都是硬编码的)。 This is the easiest way to create skins.这是创建皮肤的最简单方法。 And it allows you to perform skin's modifications easily.它使您可以轻松地进行皮肤修改。 You should choose this options if you're creating skins for the particular project with particular look and feel.如果您正在为具有特定外观的特定项目创建皮肤,则应该选择此选项。 The main advantage is you can create and modify skins very simple and fast with more flexible usage of external tools such as Flash Catalyst.主要优点是您可以通过更灵活地使用 Flash Catalyst 等外部工具来非常简单快速地创建和修改皮肤。

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

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