Skip to content

Commit 93e8ae0

Browse files
Integrated latest changes at 08-10-2023 1:30:19 AM
1 parent 18c378e commit 93e8ae0

File tree

230 files changed

+2858
-5174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+2858
-5174
lines changed

ej2-angular-toc.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,9 @@
15981598
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-azure-blob-storage">From Azure Blob Storage</a></li>
15991599
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-google-cloud-storage">From Google Cloud Storage</a></li>
16001600
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-google-drive">From Google Drive</a></li>
1601+
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-one-drive">From One Drive</a></li>
1602+
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-dropbox-cloud-file-storage">From Dropbox cloud file storage</a></li>
1603+
<li><a href="/ej2-angular/pdfviewer/open-pdf-file/from-box-cloud-file-storage">From Box cloud file storage</a></li>
16011604
</ul>
16021605
</li>
16031606
<li>Save PDF File
@@ -1606,6 +1609,9 @@
16061609
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-azure-blob-storage">To Azure Blob Storage</a></li>
16071610
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-google-cloud-storage">To Google Cloud Storage</a></li>
16081611
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-google-drive">To Google Drive</a></li>
1612+
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-one-drive">To One Drive</a></li>
1613+
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-dropbox-cloud-file-storage">To Dropbox cloud file storage</a></li>
1614+
<li><a href="/ej2-angular/pdfviewer/save-pdf-file/to-box-cloud-file-storage">To Box cloud file storage</a></li>
16091615
</ul>
16101616
</li>
16111617
<li>Annotation
Loading
49.9 KB
Loading
Loading
854 KB
Loading

ej2-angular/appearance/material 3.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
layout: post
3+
title: Material 3 Theme in Angular | Syncfusion
4+
description: Learn here all about Icons in Syncfusion Angular Appearance component of Syncfusion Essential JS 2 and more.
5+
platform: ej2-angular
6+
control: Material 3
7+
documentation: ug
8+
domainurl: ##DomainURL##
9+
---
10+
11+
# Material 3 Theme
12+
13+
Material 3 is an updated theme that encompasses enhanced theming, components, and personalization features, including dynamic color capabilities. It has been specifically designed to align seamlessly with the new visual style and system UI introduced in Android 12 and above. For more detailed information, please refer to the following link: [ Link to Material 3 Information](https://m3.material.io/).
14+
15+
## Syncfusion Material 3 Theme
16+
17+
Syncfusion has introduced the Material theme across all EJ2 Controls. The theme includes light and dark variants and utilizes CSS variables for easy customization of control colors in CSS format. This implementation enables seamless switching between light and dark color schemes, offering users a flexible solution to suit their preferences and application needs.
18+
19+
> Note: Please be aware that in the Material 3 theme, we utilize CSS variables with rgb() values for our color variables. Using hex values in this context may lead to improper functionality. For example, in previous versions of our Material theme or other themes, the primary color variable was defined as follows: `$primary: #6200ee;`. In the Material 3 theme, the primary color variable is defined as follows: `--color-sf-primary: 98, 0, 238;`.
20+
21+
## What are CSS Variables?
22+
23+
CSS variables, also known as custom properties, are a powerful feature in CSS that allows you to define reusable values and apply them throughout your stylesheets. Prefixed with "--," CSS variables can be utilized in any property value within a CSS rule. To retrieve the value of a CSS variable, the var() function is used. CSS variables can access the Document Object Model (DOM), enabling the creation of variables with either local or global scope. For further details, please consult the following link: [Link to CSS Variables Information](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties).
24+
25+
### How does Syncfusion Theming utilize CSS Variables?
26+
27+
The Material 3 theme in our system incorporates CSS variable support, utilizing CSS variables with rgb() values for color customization.
28+
29+
```CSS
30+
:root {
31+
--color-sf-black: 0, 0, 0;
32+
--color-sf-white: 255, 255, 255;
33+
--color-sf-primary: 103, 80, 164;
34+
--color-sf-primary-container: 234, 221, 255;
35+
--color-sf-secondary: 98, 91, 113;
36+
--color-sf-secondary-container: 232, 222, 248;
37+
--color-sf-tertiary: 125, 82, 96;
38+
--color-sf-tertiary-container: 255, 216, 228;
39+
--color-sf-surface: 255, 255, 255;
40+
--color-sf-surface-variant: 231, 224, 236;
41+
--color-sf-background: var(--color-sf-surface);
42+
--color-sf-on-primary: 255, 255, 255;
43+
--color-sf-on-primary-container: 33, 0, 94;
44+
--color-sf-on-secondary: 255, 255, 255;
45+
--color-sf-on-secondary-container: 30, 25, 43;
46+
--color-sf-on-tertiary: 255, 255, 255;
47+
}
48+
```
49+
50+
### Exploring Color Customization
51+
52+
Through the utilization of these CSS variables, customization of the color variables becomes remarkably straightforward. For example, to customize the primary color variable in this theme, simply modify its value in the root values.
53+
54+
**Default primary value**
55+
56+
![default primary value](images/material3-default.PNG)
57+
58+
**Customized primary value**
59+
60+
![customized primary value](images/material3-customize.PNG)
61+
62+
With this CSS variable support, you can effortlessly customize the color variable values for our EJ2 controls.
63+
64+
## Dark mode support
65+
66+
The controls in our system now seamlessly transition between light and dark modes without any noticeable delay. This achievement was made by consolidating the configurations of the light theme and dark theme into [material3 light theme](https://unpkg.com/@syncfusion/ej2@22.1.34/material3.css) file.
67+
68+
![dark mode](images/material3.gif)
69+
70+
{% tabs %}
71+
{% highlight ts tabtitle="app.component.ts" %}
72+
{% include code-snippet/common/material3-cs1/app/app.component.ts %}
73+
{% endhighlight %}
74+
{% highlight ts tabtitle="app.module.ts" %}
75+
{% include code-snippet/common/material3-cs1/app/app.module.ts %}
76+
{% endhighlight %}
77+
{% highlight ts tabtitle="main.ts" %}
78+
{% include code-snippet/common/material3-cs1/app/main.ts %}
79+
{% endhighlight %}
80+
{% endtabs %}
81+
82+
{% previewsample "page.domainurl/samples/common/material3-cs1" %}
83+
84+
The above example demonstrates the appearance of an application in dark mode. By using CSS variable support, the transition between light and dark mode is smooth and visually pleasing.
85+
86+
```CSS
87+
.e-dark-mode {
88+
--color-sf-black: 0, 0, 0;
89+
--color-sf-white: 255, 255, 255;
90+
--color-sf-primary: 208, 188, 255;
91+
--color-sf-primary-container: 79, 55, 139;
92+
--color-sf-secondary: 204, 194, 220;
93+
--color-sf-secondary-container: 74, 68, 88;
94+
--color-sf-tertiary: 239, 184, 200;
95+
--color-sf-tertiary-container: 99, 59, 72;
96+
--color-sf-surface: 28, 27, 31;
97+
--color-sf-surface-variant: 28, 27, 31;
98+
--color-sf-background: var(--color-sf-surface);
99+
--color-sf-on-primary: 55, 30, 115;
100+
--color-sf-on-primary-container: 234, 221, 255;
101+
--color-sf-on-secondary: 51, 45, 65;
102+
--color-sf-on-secondary-container: 232, 222, 248;
103+
--color-sf-on-tertiary: 73, 37, 50;
104+
}
105+
```
106+
107+
### How to switch to dark mode
108+
109+
With this CSS variable support, transitioning between light and dark theme modes has become effortless. To switch to dark mode, simply add the `e-dark-mode` class to the body section of your application. Upon adding this class, the theme will seamlessly switch to dark mode. Please refer to the example image below for guidance.
110+
111+
![dark mode](images/material3-dark.PNG)
112+
113+
## ThemeStudio application
114+
115+
The ThemeStudio application now includes seamless integration with the Material 3 theme, offering a comprehensive solution for customization requirements. This enhancement enables users to effortlessly customize and personalize their themes.
116+
117+
Access the Syncfusion ThemeStudio application, featuring the Material 3 theme, via the following link: [Link to Syncfusion ThemeStudio with Material 3 Theme](https://ej2.syncfusion.com/themestudio/?theme=material3)
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
{
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3+
"version": 1,
4+
"newProjectRoot": "projects",
5+
"projects": {
6+
"material3": {
7+
"projectType": "application",
8+
"schematics": {},
9+
"root": "",
10+
"sourceRoot": "src",
11+
"prefix": "app",
12+
"architect": {
13+
"build": {
14+
"builder": "@angular-devkit/build-angular:browser",
15+
"options": {
16+
"outputPath": "dist/material3",
17+
"index": "src/index.html",
18+
"main": "src/main.ts",
19+
"polyfills": [
20+
"zone.js"
21+
],
22+
"tsConfig": "tsconfig.app.json",
23+
"assets": [
24+
"src/favicon.ico",
25+
"src/assets"
26+
],
27+
"styles": [
28+
"src/styles.css"
29+
],
30+
"scripts": []
31+
},
32+
"configurations": {
33+
"production": {
34+
"budgets": [
35+
{
36+
"type": "initial",
37+
"maximumWarning": "500kb",
38+
"maximumError": "1mb"
39+
},
40+
{
41+
"type": "anyComponentStyle",
42+
"maximumWarning": "2kb",
43+
"maximumError": "4kb"
44+
}
45+
],
46+
"outputHashing": "all"
47+
},
48+
"development": {
49+
"buildOptimizer": false,
50+
"optimization": false,
51+
"vendorChunk": true,
52+
"extractLicenses": false,
53+
"sourceMap": true,
54+
"namedChunks": true
55+
}
56+
},
57+
"defaultConfiguration": "production"
58+
},
59+
"serve": {
60+
"builder": "@angular-devkit/build-angular:dev-server",
61+
"configurations": {
62+
"production": {
63+
"browserTarget": "material3:build:production"
64+
},
65+
"development": {
66+
"browserTarget": "material3:build:development"
67+
}
68+
},
69+
"defaultConfiguration": "development"
70+
},
71+
"extract-i18n": {
72+
"builder": "@angular-devkit/build-angular:extract-i18n",
73+
"options": {
74+
"browserTarget": "material3:build"
75+
}
76+
},
77+
"test": {
78+
"builder": "@angular-devkit/build-angular:karma",
79+
"options": {
80+
"polyfills": [
81+
"zone.js",
82+
"zone.js/testing"
83+
],
84+
"tsConfig": "tsconfig.spec.json",
85+
"assets": [
86+
"src/favicon.ico",
87+
"src/assets"
88+
],
89+
"styles": [
90+
"src/styles.css"
91+
],
92+
"scripts": []
93+
}
94+
}
95+
}
96+
}
97+
},
98+
"cli": {
99+
"analytics": "d1961fdb-0820-4c41-a2fc-4f0431831ebc"
100+
}
101+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<!-- checked state. -->
2+
<div [ngClass]="{'e-dark-mode': isChecked, 'dark': isChecked}">
3+
<ejs-checkbox label="Enable Darkmode" (change)="toggleCheckbox()"></ejs-checkbox><br/>
4+
5+
<!-- Primary Button - Used to represent a primary action. -->
6+
<button ejs-button cssClass="e-primary">Button</button>
7+
8+
<!-- Success Button - Used to represent a positive action. -->
9+
<button ejs-button cssClass="e-success">Button</button>
10+
11+
<!-- Info Button - Used to represent an informative action -->
12+
<button ejs-button cssClass="e-info">Button</button>
13+
14+
<!-- Warning Button - Used to represent an action with caution. -->
15+
<button ejs-button cssClass="e-warning">Button</button>
16+
17+
<!-- Danger Button - Used to represent a negative action. -->
18+
<button ejs-button cssClass="e-danger">Button</button>
19+
</div>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-root',
5+
styleUrls:['./style.css'],
6+
templateUrl:'app.component.html'
7+
})
8+
9+
export class AppComponent {
10+
public className:string="";
11+
public checked:boolean=true;
12+
13+
public isChecked = false;
14+
15+
toggleCheckbox() {
16+
this.isChecked = !this.isChecked;
17+
if (this.isChecked) {
18+
document.body.classList.add('dark');
19+
}
20+
else{
21+
document.body.classList.remove('dark');
22+
}
23+
}
24+
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { NgModule } from '@angular/core';
2+
import { BrowserModule } from '@angular/platform-browser';
3+
import { ButtonModule, CheckBoxModule } from '@syncfusion/ej2-angular-buttons';
4+
import { AppComponent } from './app.component';
5+
import { enableRipple } from '@syncfusion/ej2-base';
6+
import { SwitchModule} from '@syncfusion/ej2-angular-buttons';
7+
import { FormsModule } from '@angular/forms';
8+
9+
enableRipple(true);
10+
11+
/**
12+
* Module
13+
*/
14+
@NgModule({
15+
imports: [
16+
BrowserModule,
17+
ButtonModule,
18+
CheckBoxModule,
19+
SwitchModule,
20+
FormsModule
21+
],
22+
declarations: [AppComponent],
23+
bootstrap: [AppComponent]
24+
})
25+
export class AppModule { }
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2+
import { enableProdMode } from '@angular/core';
3+
import { AppModule } from './app/app.module';
4+
5+
enableProdMode();
6+
platformBrowserDynamic().bootstrapModule(AppModule);
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
button {
2+
margin: 25px 5px 20px 20px;
3+
}
4+
5+
#loader {
6+
color: #008cff;
7+
height: 40px;
8+
width: 30%;
9+
position: absolute;
10+
font-family: 'Helvetica Neue','calibiri';
11+
font-size:16px;
12+
top: 45%;
13+
left: 45%;
14+
}
15+
.dark{
16+
background-color: black;
17+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
@import '../node_modules/@syncfusion/ej2-base/styles/material3.css';
3+
@import '../node_modules/@syncfusion/ej2-buttons/styles/material3.css';
4+
@import '../node_modules/@syncfusion/ej2-angular-base/styles/material3.css';
5+
@import '../node_modules/@syncfusion/ej2-angular-buttons/styles/material3.css';
6+
button {
7+
margin: 25px 5px 20px 20px;
8+
}
9+
10+
#loader {
11+
color: #008cff;
12+
height: 40px;
13+
width: 30%;
14+
position: absolute;
15+
font-family: 'Helvetica Neue','calibiri';
16+
font-size:16px;
17+
top: 45%;
18+
left: 45%;
19+
}
20+
.dark{
21+
background-color: black;
22+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Material3</title>
6+
<base href="/">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
</head>
9+
<body>
10+
<app-root></app-root>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)