Skip to content

Commit e88eeed

Browse files
Merge pull request #2912 from syncfusion-content/EJ2-883059-LibMan
883059: updated UG content in Build-in Themes appearance
2 parents d28f5ab + d512ba9 commit e88eeed

File tree

5 files changed

+83
-2
lines changed

5 files changed

+83
-2
lines changed
Loading
Loading
Loading
Loading

ej2-asp-core-mvc/EJ2_ASP.NETCORE/appearance/theme.md

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,11 +710,11 @@ LibMan offers the following advantages,
710710

711711
![Select unpkg provider](images/client-library-unpkg.png)
712712

713-
3.you can refer the combined control styles by using `@syncfusion/ej2@{{ site.ej2version }}` in the library textbox.
713+
3.You can refer the combined control styles by using `@syncfusion/ej2@{{ site.ej2version }}` in the library textbox.
714714

715715
![Specify Syncfusion library](images/library-unpkg.png)
716716

717-
4.you can able to choose specific files or include all library files like below.
717+
4.You can able to choose specific files or include all library files like below.
718718

719719
For example, Choose specific files and the bootstrap5 theme is selected in the dialog.
720720

@@ -765,6 +765,87 @@ N> If you use individual control styles, you should install their dependent cont
765765

766766
8.Run the application and see the bootstrap5 themes downloaded from LibMan were applied.
767767

768+
You can also choose `SCSS` file and customize theme variables using the [Web Compiler 2022+](https://marketplace.visualstudio.com/items?itemName=Failwyn.WebCompiler64) by following steps.
769+
770+
![Choose SCSS file](images/library-unpkg-theme-scss.png)
771+
772+
1.Now, use a specific target location and click the install button to get the `libman.json` with the following content.
773+
774+
{% tabs %}
775+
{% highlight cshtml tabtitle="libman.json" %}
776+
777+
{
778+
"version": "1.0",
779+
"defaultProvider": "unpkg",
780+
"libraries": [
781+
{
782+
"library": "@syncfusion/ej2@{{ site.ej2version }}",
783+
"destination": "wwwroot/lib/syncfusion/ej2/",
784+
"files": [
785+
"base/bootstrap5.scss"
786+
]
787+
}
788+
]
789+
}
790+
791+
{% endhighlight %}
792+
{% endtabs %}
793+
794+
2.Open Command Prompt from the application root directory and run the following command to install the Syncfusion `node_modules` in this application.
795+
796+
{% tabs %}
797+
{% highlight c# tabtitle="CMD" %}
798+
799+
npm install @syncfusion/ej2
800+
801+
{% endhighlight %}
802+
{% endtabs %}
803+
804+
3.Open Visual Studio 2022 and click the Extensions in the toolbar.
805+
806+
![VS Extension](images/vs_extension.png)
807+
808+
4.Search the `Web Compiler 2022+` in search box and download the extension.
809+
810+
![Web Compiler 2022+](images/web_compiler.png)
811+
812+
5.Right-click the `SCSS` file and click the Web Compiler to compile the file.
813+
814+
![Themes-libman-compile](images/themes-libman-compile.png)
815+
816+
6.The `compilerconfig.json` file is created by default. Then, provide the location of the compiled CSS file and include a path as shown in the following code snippet.
817+
818+
{% tabs %}
819+
{% highlight c# tabtitle="compilerconfig.json" %}
820+
821+
[
822+
{
823+
"inputFile": "wwwroot/lib/syncfusion/ej2/base/bootstrap5.scss",
824+
"outputFile": "wwwroot/lib/syncfusion/ej2/base/bootstrap5.css",
825+
"options": {
826+
"includePath": "node_modules/@syncfusion"
827+
}
828+
}
829+
]
830+
831+
{% endhighlight %}
832+
{% endtabs %}
833+
834+
7.You can refer to the theme sheet which was downloaded from the client-side library in the `<head>` element of the **~/Pages/Shared/_Layout.cshtml** file.
835+
836+
{% tabs %}
837+
{% highlight cshtml tabtitle="~/_Layout.cshtml" %}
838+
839+
<head>
840+
...
841+
<link href="~/lib/syncfusion/ej2/base/bootstrap5.css" rel="stylesheet" />
842+
</head>
843+
844+
{% endhighlight %}
845+
{% endtabs %}
846+
847+
8.Run the application and see the bootstrap5 themes downloaded from LibMan were applied.
848+
768849
N> [View sample in GitHub](https://github.com/SyncfusionExamples/asp-net-core-libman)
769850

770851
## Change theme dynamically

0 commit comments

Comments
 (0)