Material design is a versatile set of guidelines that support the best practices of user interface design. It provides uniform specifications for themes, layouts, animation, components, and typography to let you express your brand with confidence. Material design is inspired by the physical world and its texture - how they reflect light, and cast shadows with a minimalist and clean approach.
Google announced Material and it’s specification in mid-2014, defining Material as based on paper and ink with advanced implementations. As of today, all of Google’s mobile applications for Android have applied Material.
ComponentOne MVC controls lets you add Material design look and feel by using Material Design Lite. It does not rely on any JS framework. It only takes two steps to add material support in your application. Our material theme should work in all evergreen browsers alike, with full support in Chrome for Android and Mobile Safari. For older browsers like IE9, we degrade to CSS only.
There are two ways to use our inbuilt Material themes: with HTML/tag helpers and with our theme builder.
All the resources used with ComponentOne controls are registered when you create a web application using our MVC template. By default, when you create an MVC application with ComponentOne controls, it uses a default theme. You are provided many different pre-defined visual themes. The themes are consistent across all the ComponentOne controls for your project.
- If you are using ComponentOne Template you can use the application Wizard to set the theme.
- If you are using a Visual Studio Template you can set material theme manually while registering resources for your application.
To apply material theme in your application, you need to add the following code in Layout.cshtml (Views/Shared/Layout.cshtml)
Material themes are written in a specific format to allow several combinations of primary/accent colours. The format is:
We’ve also made an interactive theme builder. This builder allows you to choose colors and preview your theme with our controls before adding them to your application. If you are using a combination (of primary and accent colors) you would have to include a specific CSS file, compared to some other combination. Therefore, we felt it was necessary to provide you an interactive theme builder, that will decide what resources you need to download and include in you web application. You can also preview how these different combinations of primary and accent colours looks with C1 MVC controls.
Follow these steps:
- Use our theme builder to decide some colour combinations. After deciding some arbitrary colour combination, you would be provided with a code to include in your layout page. See Example
- You can optionally include Material Icons in your application: See Example