简体   繁体   English

创建自定义角度材质主题时,最佳方法是什么?

[英]What is the best approach when creating a custom angular material theme?

I'm trying to understand how to best work with Angular-material theming: 我试图了解如何最好地使用Angular-material主题:

Google's giving out a wide range of color palettes , And also provides guides on how to easily switch between palettes . 谷歌提供各种调色板 ,并提供如何在调色板之间轻松切换的指南。

I've seen this question , And found a bunch of tools to generate a palette around a main color ( tool1 , tool2 ) 我已经看到了这个问题 ,并找到了一堆工具来生成一个主色调的工具tool1tool2

Although when getting a custom design from a designer, where different colors were picked, I find it difficult to implement design colors as a complete theme, as there are too many variables to take into account (such as hover shades, ink-ripple shades etc.). 虽然从设计师那里获得定制设计时,选择了不同的颜色,我发现很难将设计颜色作为一个完整的主题来实现, 因为有太多的变量需要考虑 (如悬停阴影,墨水波纹阴影等)。

My question is: 我的问题是:

  1. Can I as a developer create a well enough eye pleasing theme from every design that is delivered to me (either by JS theming, or CSS overrides), or are there any restrictions to take into account? 作为开发人员,我可以从每个设计中创建一个足够令人愉悦的主题(通过JS主题或CSS覆盖),还是有任何限制要考虑?

  2. Should the designer take some guidelines into account when creating the design? 设计师在创建设计时是否应该考虑一些指导原则?

  3. Should we give away flexibility in design by going with one of Google's pre-defined palettes? 我们是否应该通过使用Google预定义的调色板来放弃设计的灵活性?

** **

Edit - 05/2017: 编辑 - 05/2017:

I've decided to completely turn off theming since I couldn't fully understand how to customize it to our needs. 我决定完全关闭主题,因为我无法完全理解如何根据我们的需求定制它。

Im now injecting variables through webpack into SASS files and the outcode is much more sane. 我现在通过webpack将变量注入到SASS文件中,并且outcode更加清晰。

** **

  1. No, not currently. 不,不是。 "Well-pleasing" is a broad, opinion-based term that is not decided by logical algorithm. “令人愉悦”是一个广泛的,基于意见的术语,不是由逻辑算法决定的。 I actually have tried to do exactly this for months before I finally learned enough about UI design to know it wouldn't work. 实际上我已经尝试过这几个月,直到我终于学会了足够的UI设计才知道它不起作用。

  2. Google's material design guideline is all that's needed for a designer to create a Material Theme. Google的材料设计指南是设计师创建材质主题所需的全部内容。 It's not that long and a typical designer can skim through it in about an hour. 它不是那么久,一个典型的设计师可以在大约一个小时内浏览它。

  3. No. Google's pre-defined palettes are meant to be used by programmers to quickly create sites with acceptable interface. 不会.Google的预定义调色板旨在供程序员用来快速创建具有可接受界面的网站。 Unless you work specifically for Google, there's no reason to limit the designer's palette. 除非您专门为Google工作,否则没有理由限制设计师的调色板。 They are totally fine as guidelines, though. 不过,它们完全可以作为指导方针。 See Dark Material UI , a design concept based on Material Design but doesn't adhere to many part of the guidelines (for example it uses colors not included in Google's color palettes) 请参阅Dark Material UI ,这是一种基于Material Design的设计概念,但不遵循指南的许多部分(例如,它使用的是Google调色板中未包含的颜色)

The approach that we use is simply changing the href of css file in your html head section. 我们使用的方法只是在html head部分中更改css文件的href。 In this case you have standalone css file for every theme, and when you need to switch, you simply modify href. 在这种情况下,每个主题都有独立的css文件,当你需要切换时,你只需修改href。

No need to use additional markup as google recommends, because it will be to complicated to switch between themes, especially if there lots of themes. 不需要像谷歌推荐的那样使用额外的标记,因为在主题之间切换会很复杂,特别是如果有很多主题。

You can look at an example here: http://docs.telerik.com/kendo-ui/styles-and-layout/how-to/change-themes-on-the-client 你可以在这里看一个例子: http//docs.telerik.com/kendo-ui/styles-and-layout/how-to/change-themes-on-the-client

There is a live example available. 有一个现场的例子。 And material theme as well. 而物质主题也是如此。

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

相关问题 在javascript中创建消息模型的最佳方法是什么? - What is the best approach to creating message models in javascript? Angular:制作五列的最佳方法是什么? - Angular: What is the best approach to make five columns? 在Angular Material排序标题中创建自定义箭头 - Creating custom arrow in Angular Material sort header Angular 素材主题服务 - Angular material theme service 如何在$ mdToast角度材质中一起使用自定义主题和模板 - How to use custom theme and template together in $mdToast of angular material 用有角JS创建表格以在单元格更改时突出显示的好方法是什么? - What's a good approach to creating a table in angular JS that highlights cells when they change? 在角度6中制作动态可配置表的最佳方法是什么? - what is the best approach to make a dynamic and configurable table in angular 6? Angular 2+计时器要应用相同,最好的方法是什么? - Angular 2+ timer for to app the same, what would be the best approach? 将数据传递到自定义绑定处理程序的最佳方法是什么 - What is the best approach to passing data to a custom binding handler 具有远程数据源的角材料设计自动完成及其性能与最佳方法 - Angular Material Design Autocomplete With Remote Data Source and it's Performance vs best approach
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM