<?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>flex | Bogdan's blog</title>
	<atom:link href="https://blog.bogdancarpean.com/tag/flex/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.bogdancarpean.com</link>
	<description>Code and anything else.</description>
	<lastBuildDate>Fri, 18 Aug 2017 02:48:41 +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>flex | Bogdan's blog</title>
	<link>https://blog.bogdancarpean.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to apply flex on Angular component</title>
		<link>https://blog.bogdancarpean.com/how-to-apply-flex-on-angular-component/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-apply-flex-on-angular-component</link>
					<comments>https://blog.bogdancarpean.com/how-to-apply-flex-on-angular-component/#respond</comments>
		
		<dc:creator><![CDATA[Bogdan]]></dc:creator>
		<pubDate>Fri, 18 Aug 2017 02:48:41 +0000</pubDate>
				<category><![CDATA[Angular 2]]></category>
		<category><![CDATA[TypeScript]]></category>
		<category><![CDATA[angular]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[flexbox]]></category>
		<category><![CDATA[html]]></category>
		<guid isPermaLink="false">http://blog.bogdancarpean.com/?p=96</guid>

					<description><![CDATA[<p>Note: given the semver adopted from now on by Angular team, I will refer to all versions of Angular2+ as Angular. For the old Angular 1.x I will use AngularJS. Supposing you want to use the flexbox CSS property to style your Angular app. So you will have a cascade of flex element that at some [&#8230;]</p>
The post <a href="https://blog.bogdancarpean.com/how-to-apply-flex-on-angular-component/">How to apply flex on Angular component</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></description>
										<content:encoded><![CDATA[<p><strong>Note</strong>: <em>given the </em>semver<em> </em>adopted<em> from now on by </em>Angular<em> team, I will refer to all versions of Angular2+ as Angular. For the old Angular </em>1.x<em> I will use AngularJS.</em></p>
<p>Supposing you want to use the flexbox CSS property to style your Angular app. So you will have a cascade of flex element that at some point will look like this:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="html">&lt;div class="wrapper"&gt; //flex parent
  &lt;angular-component&gt;&lt;/angular-component&gt;
    &lt;div class="children"&gt; //flex children - inside angular component
    //some content
    &lt;/div&gt;
&lt;/div&gt;</pre>
<p>Now you realize that you cannot apply flex property on the child, because the angular-element is cutting the flex tree.</p>
<p>The solution for this problem is to apply flex property on angular-component using `:host` selector on component CSS style:</p>
<pre class="EnlighterJSRAW" data-enlighter-language="css">:host {
    display: flex;
}</pre>
<p>This will apply flex property to the generated DOM node representing the angular-element, thus not breaking the flex tree.</p>The post <a href="https://blog.bogdancarpean.com/how-to-apply-flex-on-angular-component/">How to apply flex on Angular component</a> first appeared on <a href="https://blog.bogdancarpean.com">Bogdan's blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://blog.bogdancarpean.com/how-to-apply-flex-on-angular-component/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
