<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sass | Bogdan's blog</title>
	<atom:link href="https://blog.bogdancarpean.com/tag/sass/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.bogdancarpean.com</link>
	<description>Code and anything else.</description>
	<lastBuildDate>Fri, 24 Jan 2020 18:53:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>

<image>
	<url>https://blog.bogdancarpean.com/wp-content/uploads/2022/12/icons8-pencil-drawing-96.png</url>
	<title>sass | Bogdan's blog</title>
	<link>https://blog.bogdancarpean.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to @extend sass classes or use sass global variables in Vue components</title>
		<link>https://blog.bogdancarpean.com/how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components</link>
					<comments>https://blog.bogdancarpean.com/how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components/#respond</comments>
		
		<dc:creator><![CDATA[Bogdan]]></dc:creator>
		<pubDate>Wed, 20 Mar 2019 04:16:21 +0000</pubDate>
				<category><![CDATA[css]]></category>
		<category><![CDATA[vuejs]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[vue]]></category>
		<guid isPermaLink="false">http://blog.bogdancarpean.com/?p=274</guid>

					<description><![CDATA[<p>Extend classes and use of variables are two of the sass most powerful tools. But using them in a VueJS application could be a little bit tricky. In this article, I will show you a way of using these two on components without the need for importing the sheet containing them at each usage. Let&#8217;s [&#8230;]</p>
The post <a href="https://blog.bogdancarpean.com/how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components/">How to @extend sass classes or use sass global variables in Vue components</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></description>
										<content:encoded><![CDATA[<figure class="wp-block-image"><figcaption>Extend classes and use of variables are two of the sass most powerful tools. But using them in a VueJS application could be a little bit tricky. In this article, I will show you a way of using these two on components without the need for importing the sheet containing them at each usage.</p>
<p style="text-align: left;">Let&#8217;s assume that you have a class that you want to extend</p>
<pre class="EnlighterJSRAW" data-enlighter-language="css" data-enlighter-theme="classic">src/styles/style.scss

.my_class_to_extend {
  backgroud-color: aqua;
}</pre>
<p style="text-align: left;">Assuming you generated your project with @vue/cli, you have to add the following statement to vue.config.js in order to have file visibility throughout your application</p>
<pre class="EnlighterJSRAW" data-enlighter-language="js">module.exports = {
  css: {
    loaderOptions: {
      sass: {
        data: `@import "@/styles/style.scss";`
      }
    }
  }
}</pre>
<p style="text-align: left;">Then, you can use @extend on which component you want</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;style lang="scss" scoped&gt;
.my_extended_class {
  @extend .my_class_to_extend;
}
&lt;/style&gt;</pre>
<p style="text-align: left;">Remember that you have to use sass in both extended and extender sheets for this to work.</p>
</figcaption></figure>The post <a href="https://blog.bogdancarpean.com/how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components/">How to @extend sass classes or use sass global variables in Vue components</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://blog.bogdancarpean.com/how-to-extend-sass-classes-or-use-sass-global-variables-in-vue-components/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Create custom color theme on Angular Material</title>
		<link>https://blog.bogdancarpean.com/create-custom-color-theme-on-angular-material/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=create-custom-color-theme-on-angular-material</link>
					<comments>https://blog.bogdancarpean.com/create-custom-color-theme-on-angular-material/#respond</comments>
		
		<dc:creator><![CDATA[Bogdan]]></dc:creator>
		<pubDate>Thu, 01 Feb 2018 02:04:34 +0000</pubDate>
				<category><![CDATA[Angular Material]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[custom color]]></category>
		<category><![CDATA[custom theme]]></category>
		<category><![CDATA[material]]></category>
		<category><![CDATA[material design]]></category>
		<category><![CDATA[sass]]></category>
		<guid isPermaLink="false">http://blog.bogdancarpean.com/?p=197</guid>

					<description><![CDATA[<p>Most of the time when building an Angular Material application, you will need to customize your color palette, so that you adapt the look of your application to your client&#8217;s brand. In this article, we are going to do that customization for an Angular app that uses Angular Material. When you add Angular Material to [&#8230;]</p>
The post <a href="https://blog.bogdancarpean.com/create-custom-color-theme-on-angular-material/">Create custom color theme on Angular Material</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></description>
										<content:encoded><![CDATA[<div style="position: relative;">Most of the time when building an Angular Material application, you will need to customize your color palette, so that you adapt the look of your application to your client&#8217;s brand. In this article, we are going to do that customization for an Angular app that uses Angular Material.</div>
<div style="position: relative;">When you add Angular Material to your app, you have the choice of four pre-built themes: deeppurple-amber, indigo-pink, pink-bluegrey or purple-green.</div>
<div>An Angular Material theme is based on five color palettes, each palette being just a collection of nuances generated from one main color: the primary palette (the main color used across the application), the accent palette (color used for floating action button and interactive elements), the warn palette (used for all error displays), the foreground palette (used for text and icons) and the background palette (used for element backgrounds).</div>
<div></div>
<div>Let&#8217;s say we are going to define a custom theme using three colors: the primary color, the accent (or the contrast) color and the warn color. For the first two, we are going to generate custom palettes, for the third, we are going to use the <code>material red</code> predefined palette.</div>
<div></div>
<div>First, we are going to generate a scss file, let&#8217;s call it <code>your-theme.scss</code>, in a common zone folder, let&#8217;s say <code>app/common/themes</code>.</div>
<div>Into this file, we are going to <code>@import</code> the theming file from Angular Material which contains the <code>mat-core()</code> mixin, containing all the common styles used by material components. (<code>mat-core()</code> should only be included once in your app to not duplicate the common styles).</div>
<div></div>
<div>
<pre class="EnlighterJSRAW" data-enlighter-language="css">@import '../node_modules/@angular/material/theming';

@include mat-core();</pre>
<p>Next, we need to generate the material palettes for our two custom colors (primary and accent). An excellent site to do this is <a href="http://mcg.mbitson.com" target="_blank" rel="noopener noreferrer">mcg.mbitson.com</a>. In our example, we are going to use <code>#008a00</code> as the primary custom color and <code>#ca5d1e</code> as the accent color. On the generator, enter the name you want for your color variable, click on the arrow on the right of the color box on the header and enter the color code in the input field under the color picker. Click choose and you will see the material nuances generated from your custom color. To export the palette, click on the clipboard icon on the header, then choose <code>output format</code> Angular JS 2 (Material 2). Copy the generated code in our <code>your-theme.scss</code> file. Do the same for the accent color. We will end up having the two custom color material palettes:</p>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="null">@import '../node_modules/@angular/material/theming'; @include mat-core();

@include mat-core();

$my-primary: (
    50 : #e0f1e0,
    100 : #b3dcb3,
    200 : #80c580,
    300 : #4dad4d,
    400 : #269c26,
    500 : #008a00,
    600 : #008200,
    700 : #007700,
    800 : #006d00,
    900 : #005a00,
    A100 : #8bff8b,
    A200 : #58ff58,
    A400 : #25ff25,
    A700 : #0cff0c,
    contrast: (
        50 : #000000,
        100 : #000000,
        200 : #000000,
        300 : #000000,
        400 : #ffffff,
        500 : #ffffff,
        600 : #ffffff,
        700 : #ffffff,
        800 : #ffffff,
        900 : #ffffff,
        A100 : #000000,
        A200 : #000000,
        A400 : #000000,
        A700 : #000000,
    )
);

$my-accent: (
    50 : #f9ece4,
    100 : #efcebc,
    200 : #e5ae8f,
    300 : #da8e62,
    400 : #d27540,
    500 : #ca5d1e,
    600 : #c5551a,
    700 : #bd4b16,
    800 : #b74112,
    900 : #ab300a,
    A100 : #ffdfd7,
    A200 : #ffb5a4,
    A400 : #ff8c71,
    A700 : #ff7858,
    contrast: (
        50 : #000000,
        100 : #000000,
        200 : #000000,
        300 : #000000,
        400 : #000000,
        500 : #ffffff,
        600 : #ffffff,
        700 : #ffffff,
        800 : #ffffff,
        900 : #ffffff,
        A100 : #000000,
        A200 : #000000,
        A400 : #000000,
        A700 : #000000,
    )
);</pre>
<p>Now, all we have left to do is to declare the three palettes, declare the new theme using the three palettes and then add the newly created theme into the material themes.</p>
<div style="position: relative;">
<pre class="EnlighterJSRAW" data-enlighter-language="css">@import '../node_modules/@angular/material/theming';

@include mat-core();


$my-primary: (
    50 : #e0f1e0,
    100 : #b3dcb3,
    200 : #80c580,
    300 : #4dad4d,
    400 : #269c26,
    500 : #008a00,
    600 : #008200,
    700 : #007700,
    800 : #006d00,
    900 : #005a00,
    A100 : #8bff8b,
    A200 : #58ff58,
    A400 : #25ff25,
    A700 : #0cff0c,
    contrast: (
        50 : #000000,
        100 : #000000,
        200 : #000000,
        300 : #000000,
        400 : #ffffff,
        500 : #ffffff,
        600 : #ffffff,
        700 : #ffffff,
        800 : #ffffff,
        900 : #ffffff,
        A100 : #000000,
        A200 : #000000,
        A400 : #000000,
        A700 : #000000,
    )
);

$my-accent: (
    50 : #f9ece4,
    100 : #efcebc,
    200 : #e5ae8f,
    300 : #da8e62,
    400 : #d27540,
    500 : #ca5d1e,
    600 : #c5551a,
    700 : #bd4b16,
    800 : #b74112,
    900 : #ab300a,
    A100 : #ffdfd7,
    A200 : #ffb5a4,
    A400 : #ff8c71,
    A700 : #ff7858,
    contrast: (
        50 : #000000,
        100 : #000000,
        200 : #000000,
        300 : #000000,
        400 : #000000,
        500 : #ffffff,
        600 : #ffffff,
        700 : #ffffff,
        800 : #ffffff,
        900 : #ffffff,
        A100 : #000000,
        A200 : #000000,
        A400 : #000000,
        A700 : #000000,
    )
);

//the first two are the custom palettes we declared above
$my-theme-primary: mat-palette($my-primary);
$my-theme-accent: mat-palette($my-accent);
//the third, for the warn color, is the predefined material red palette
$my-theme-warn: mat-palette($mat-red);

$my-theme: mat-light-theme($my-theme-primary, $my-theme-accent, $my-theme-warn);

@include angular-material-theme($my-theme);</pre>
<p>The only one thing left to do is to import the generated theme file into the <code>styles.scss</code> file found in the root of your application</p>
</div>
<pre class="EnlighterJSRAW" data-enlighter-language="css">@import "./path/to/your-theme.scss"</pre>
<p><em>If you&#8217;re in Montreal and passionate about Angular, come meet at <a href="https://www.meetup.com/Angular-Montreal">Angular Montreal Meetup</a></em></p>The post <a href="https://blog.bogdancarpean.com/create-custom-color-theme-on-angular-material/">Create custom color theme on Angular Material</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://blog.bogdancarpean.com/create-custom-color-theme-on-angular-material/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
