mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-20 17:30:14 +01:00
Updates
This commit is contained in:
parent
be84925112
commit
00a47bf22f
9 changed files with 93 additions and 94 deletions
|
|
@ -50,10 +50,10 @@
|
|||
</div>
|
||||
<div class="inner-content">
|
||||
<h1>Changing Color Scheme</h1>
|
||||
<div class="subHeader"></div><p>We tried to make the process of color scheme customization as easy as possible. </p>
|
||||
<div class="subHeader"></div><p>We tried to make the process of color scheme customization as easy as<span class="widont"> </span>possible. </p>
|
||||
<p>By default ng2-admin has three built-in color profiles: ng2 (default blue sheme), mint and blur.
|
||||
This article will help you to create your own color profile.
|
||||
Let’s say you want to make ng2-admin dark theme.</p>
|
||||
Let’s say you want to make ng2-admin dark<span class="widont"> </span>theme.</p>
|
||||
<p>First we advise you to take some existing colorscheme file as a starting point.
|
||||
For light themes we suggest taking <code>src/app/theme/sass/conf/colorScheme/_mint.scss</code> and for
|
||||
dark <code>src/app/theme/sass/conf/colorScheme/_blue.scss</code>.
|
||||
|
|
@ -61,30 +61,30 @@ As we want a dark theme, we’re taking <code>blue</code>.</p>
|
|||
<p>1) Copy <code>src/app/theme/sass/conf/colorScheme/_mint.scss</code> to <code>src/app/theme/sass/conf/colorScheme/_dark.scss</code>:
|
||||
<br><br></p>
|
||||
<p>2) Include your colorscheme file in <code>src/app/theme/sass/conf/conf.scss</code>.</p>
|
||||
<p>To do this, replace</p>
|
||||
<pre><code class="lang-scss">@<span class="keyword">import</span> <span class="string">'colorSchemes/ng2'</span>;
|
||||
<p>To do this,<span class="widont"> </span>replace</p>
|
||||
<pre><code class="lang-scss"><span class="at_rule">@<span class="keyword">import</span> <span class="string">'colorSchemes/ng2'</span>;</span>
|
||||
</code></pre>
|
||||
<p>with</p>
|
||||
<pre><code class="lang-scss">@<span class="keyword">import</span> <span class="string">'colorSchemes/dark'</span>;
|
||||
<pre><code class="lang-scss"><span class="at_rule">@<span class="keyword">import</span> <span class="string">'colorSchemes/dark'</span>;</span>
|
||||
</code></pre>
|
||||
<p><br><br></p>
|
||||
<p>3) Change the color scheme enabled:</p>
|
||||
<p>3) Change the color scheme<span class="widont"> </span>enabled:</p>
|
||||
<p>Open <code>src/app/theme/theme.config.ts</code>.
|
||||
Uncomment the following line</p>
|
||||
Uncomment the following<span class="widont"> </span>line</p>
|
||||
<pre><code class="lang-javascript"> <span class="comment">//this._baConfig.changeTheme({name: 'my-theme'});</span>
|
||||
</code></pre>
|
||||
<p>and put your theme name, in our case it is <code>dark</code></p>
|
||||
<pre><code class="lang-javascript"> <span class="keyword">this</span>._baConfig.changeTheme({name: <span class="string">'dark'</span>});
|
||||
</code></pre>
|
||||
<p>Beside notifying the system which scheme is currently enabled, this also puts a css class to a main element
|
||||
of the page. Thus you can freely create theme-specific css selectors in your code without breakking other themes’ styles.</p>
|
||||
<p>For example like this:</p>
|
||||
<pre><code class="lang-scss">. dark <span class="selector-class">.card-body</span> {
|
||||
<span class="attribute">background-color</span>: white;
|
||||
of the page. Thus you can freely create theme-specific css selectors in your code without breakking other themes’<span class="widont"> </span>styles.</p>
|
||||
<p>For example like<span class="widont"> </span>this:</p>
|
||||
<pre><code class="lang-scss">. dark <span class="class">.card-body</span> {
|
||||
<span class="attribute">background-color</span><span class="value">: white;</span>
|
||||
}
|
||||
</code></pre>
|
||||
<p><br><br></p>
|
||||
<p>4) Change the colors:</p>
|
||||
<p>4) Change the<span class="widont"> </span>colors:</p>
|
||||
<p>Now you can start changing the colors.
|
||||
For example, after playing a bit with different colors, we changed the 2 first main variables in <code>_dark.scss</code> file:</p>
|
||||
<pre><code class="lang-sass">$body-bg: #636363;
|
||||
|
|
@ -135,14 +135,14 @@ To do this, add the following code to the configuration block inside <code>src/a
|
|||
});
|
||||
</code></pre>
|
||||
<p>Here we defined a list of main colors <code>colorScheme</code> and then made light and dark versions of those using <code>colorHelper</code> methods.
|
||||
We also defined a couple of custom colors for dashboard charts.</p>
|
||||
<p>That’s basically it! Right now your admin application should look like this:</p>
|
||||
We also defined a couple of custom colors for dashboard<span class="widont"> </span>charts.</p>
|
||||
<p>That’s basically it! Right now your admin application should look like<span class="widont"> </span>this:</p>
|
||||
<p><img src="/ng2-admin/articles/011-changing-color-scheme/new-color-scheme.png" alt=""></p>
|
||||
<p>For further reference, please look in</p>
|
||||
<p>For further reference, please look<span class="widont"> </span>in</p>
|
||||
<ul>
|
||||
<li>Colorscheme scss file (<code>src/app/theme/sass/conf/colorScheme/_ng2.scss</code>, <code>src/app/theme/sass/conf/colorScheme/_mint.scss</code> and <code>src/app/theme/sass/conf/colorScheme/_blur.scss</code>)</li>
|
||||
<li><code>src/app/theme/theme.configProvider.js</code> to understand which javascript colors can be changed</li>
|
||||
<li>If you want to know how to change the theme to blur, read the <a href="/ng2-admin/articles/014-switch-to-blur-theme/">following article</a></li>
|
||||
<li><code>src/app/theme/theme.configProvider.js</code> to understand which javascript colors can be<span class="widont"> </span>changed</li>
|
||||
<li>If you want to know how to change the theme to blur, read the <a href="/ng2-admin/articles/014-switch-to-blur-theme/">following<span class="widont"> </span>article</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue