What is @progress/kendo-theme-default?
@progress/kendo-theme-default is a theme package for Kendo UI components. It provides a default styling theme that can be applied to Kendo UI widgets to ensure a consistent and visually appealing design across your application.
What are @progress/kendo-theme-default's main functionalities?
Applying Default Theme to Kendo UI Components
This code imports the default theme CSS file, which applies the default Kendo UI styling to all Kendo UI components in your application.
import '@progress/kendo-theme-default/dist/all.css';
Customizing Theme Variables
This code demonstrates how to customize the default theme by overriding SCSS variables. You can change the primary and secondary colors and then apply the custom theme using the `kendo-theme` mixin.
/* Import the default theme */
@import "~@progress/kendo-theme-default/scss/all";
/* Override variables */
$primary: #ff0000;
$secondary: #00ff00;
/* Apply the custom theme */
@include kendo-theme();
Using Theme with Angular
This code shows how to use the default theme in an Angular application. It imports the theme CSS and applies it to a Kendo UI button component.
import { Component } from '@angular/core';
import '@progress/kendo-theme-default/dist/all.css';
@Component({
selector: 'my-app',
template: `<kendo-button>My Kendo Button</kendo-button>`
})
export class AppComponent {}
Other packages similar to @progress/kendo-theme-default
bootstrap
Bootstrap is a popular CSS framework that provides a wide range of pre-styled components and utilities. Unlike @progress/kendo-theme-default, which is specifically designed for Kendo UI components, Bootstrap can be used with any HTML elements and offers a more general-purpose solution.
material-ui
Material-UI is a React component library that implements Google's Material Design. It provides a set of pre-styled components similar to Kendo UI but is specifically tailored for React applications. Material-UI offers a different design aesthetic compared to the default Kendo theme.
ant-design
Ant Design is a comprehensive design system and React UI library. It offers a wide range of components and themes, similar to Kendo UI, but is focused on providing a consistent design language for enterprise applications. Ant Design provides more customization options and a different design philosophy compared to the default Kendo theme.
Kendo UI Default Theme
Overview
The Kendo UI Default Theme is a SCSS-based theme for the Kendo UI components.
Currently, it is available for the following suites:
- Kendo UI for React.
- Kendo UI for Angular 2.
We are working on providing support for the Default Theme in Kendo UI jQuery suite too.
Basic Usage
For more information on how to use the Default Theme in Angular 2 and React projects, refer to its introductory topic.
Customization
To customize the Default Theme in one swoop, use the colors defined in the styles/_variables.scss
file. Any change in this file is propagated to every component.
To style a specific component, use the variables used in its specific .scss
file.
The theme is built by running npm run build
. The dist/all.css
file contains the complete theme that you can use in your project.
Development
Styles are split into components and the dependencies are managed by the import-once
mixin. When configuring the styles, define them within an import-once
block so that they are bundled once when required from multiple files.
During development, the SCSS files are linted on every commit
and built on every push
command. The theme package can be tested against a component by linking the theme in the components package.
Upon build, browser-specific properties are generated through the PostCSS autoprefixer.
When updating resources (images or fonts), run the npm run embed-assets
task. This will generate a file with the same name, which registers a base64-encoded version in the $data-uris
SCSS map. For example, the font file foo.woff
will receive a foo.scss
file, which can later be imported via @import './font/foo';
. Then the base64 version can be inlined via map-get( $data-uris, 'WebComponentsIcons.woff' )
. This is done in order to workaround problems with hosting resources when consuming the theme. See issue #41 for more details.