1 | # Kendo UI Fluent Theme
|
2 |
|
3 | The Kendo UI Fluent Theme is a SCSS-based theme for the Kendo UI components which is based on the [Fluent Design System](https://www.microsoft.com/design/fluent/#/).
|
4 |
|
5 | * [Quick start](#quick-start)
|
6 | * [Customizing](#customizing)
|
7 | * [Bug reports and feature requests](#bug-reports-and-feature-requests)
|
8 | * [Versioning](#versioning)
|
9 | * [License](#license)
|
10 |
|
11 | ## Quick start
|
12 |
|
13 | Kendo UI Fluent Theme is available as an npm package.
|
14 |
|
15 | If you don't need to apply any [customization](#customizing) to the theme, you can can reference the precompiled CSS directly from unpkg CDN:
|
16 |
|
17 | ```html
|
18 | <link rel="stylesheet" href="https://unpkg.com/@progress/kendo-theme-fluent/dist/all.css" />
|
19 | ```
|
20 |
|
21 | While using the pre-compiled CSS file is faster than compiling the theme from the source code, the approach has the two drawbacks: it includes CSS for all components; it does not provide options for theme customization through SCSS variables (which is possible when you build the theme from the source code) because the theme is already compiled.
|
22 |
|
23 | If you prefer, or you need to customize the theme, you can install it:
|
24 |
|
25 | ```sh
|
26 | npm install --save @progress/kendo-theme-fluent
|
27 | ```
|
28 |
|
29 | and then import it in your project styles:
|
30 |
|
31 | ```scss
|
32 | // Import the entire theme
|
33 | @use "@progress/kendo-theme-fluent/scss/all.scss" as *;
|
34 | ```
|
35 |
|
36 | ## Importing
|
37 |
|
38 | In your custom scss file, you can import the entirety of the theme, by importing `scss/all.scss` or pick just the styles for the components you need. The files for individual components:
|
39 |
|
40 | ```scss
|
41 | // Import only Button and Grid styles
|
42 | @use "@progress/kendo-theme-default/scss/index.scss" as *;
|
43 |
|
44 | @include kendo-button--styles();
|
45 | @include kendo-grid--styles();
|
46 | ```
|
47 |
|
48 | ## SCSS Variables Customization
|
49 |
|
50 | The Kendo UI Fluent theme enables customization through SCSS variables as follows:
|
51 |
|
52 | ```scss
|
53 | @use "@progress/kendo-theme-fluent/scss/all.scss" as kendo-theme with (
|
54 | $kendo-body-bg: beige,
|
55 | $kendo-font-size: 1rem
|
56 | );
|
57 | ```
|
58 |
|
59 | or:
|
60 |
|
61 | ```scss
|
62 | @use "@progress/kendo-theme-fluent/scss/all.scss" as kendo-theme;
|
63 |
|
64 | kendo-theme.$kendo-body-bg: beige;
|
65 | kendo-theme.$kendo-font-size: 30px;
|
66 | ```
|
67 |
|
68 | ## CSS Variables Customization
|
69 |
|
70 | The theme is also making use of CSS custom properties in its compiled output for runtime customization. This eliminates the need to recompile the theme from the source.
|
71 |
|
72 | ### Root variables
|
73 |
|
74 | The theme exposes global [root variables](https://github.com/telerik/kendo-themes/blob/develop/packages/fluent/scss/core/_variables.scss#L106-L133) that can be used anywhere on the page to dynamically customize the theme:
|
75 |
|
76 | ```css
|
77 | body {
|
78 | --kendo-font-size: 1.2rem;
|
79 | }
|
80 | ```
|
81 |
|
82 | ### Component variables
|
83 |
|
84 | The theme also exposes CSS variables for all components and allows dynamic restyling:
|
85 |
|
86 | ```css
|
87 | .k-button-solid-primary {
|
88 | --kendo-button-text: #fff;
|
89 | --kendo-button-bg: #28a745;
|
90 | --kendo-button-border: #28a745;
|
91 |
|
92 | --kendo-button-hover-text: #fff;
|
93 | --kendo-button-hover-bg: #218838;
|
94 | --kendo-button-hover-border: #218838;
|
95 |
|
96 | --kendo-button-focus-text: #fff;
|
97 | --kendo-button-focus-bg: #28a745;
|
98 | --kendo-button-focus-border: #28a745;
|
99 |
|
100 | --kendo-button-active-text: #fff;
|
101 | --kendo-button-active-bg: #1e7e34;
|
102 | --kendo-button-active-border: #1e7e34;
|
103 | }
|
104 | ```
|
105 |
|
106 | ## Bug reports and feature requests
|
107 |
|
108 | Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, please open a new [bug report](https://github.com/telerik/kendo-themes/issues/new?labels=bug,T:Fluent&template=bug_report.md) or [feature request](https://github.com/telerik/kendo-themes/issues/new?labels=Enhancement,T:Fluent&template=feature_request.md).
|
109 |
|
110 | ## Versioning
|
111 |
|
112 | To ensure version predictability, we use [Semantic Versioning](https://semver.org/): we try to add only features for minor versions and bugfixes (or smaller features) for patch version.
|
113 |
|
114 | ## License
|
115 |
|
116 | This package is part of the following suites:
|
117 |
|
118 | * [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/)
|
119 | * [KendoReact](https://www.telerik.com/kendo-react-ui/)
|
120 | * [Kendo UI for Vue](https://www.telerik.com/kendo-vue-ui)
|
121 |
|
122 | All available Kendo UI commercial licenses may be obtained at http://www.telerik.com/purchase/kendo-ui.
|
123 |
|
124 | If you do not own a commercial license, the usage of this software shall be governed by the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
|
125 |
|
126 | *Copyright © 2022 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
127 |
|
128 | *Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|