<?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>Trim Agency &#187; css</title>
	<atom:link href="http://old.trimagency.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://old.trimagency.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Jun 2026 06:32:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Styling Select Elements with JCF</title>
		<link>http://old.trimagency.com/styling-select-elements-with-jcf/</link>
		<comments>http://old.trimagency.com/styling-select-elements-with-jcf/#comments</comments>
		<pubDate>Fri, 22 Sep 2017 19:44:41 +0000</pubDate>
		<dc:creator><![CDATA[Steph Ricardo]]></dc:creator>
				<category><![CDATA[Today I Learned]]></category>
		<category><![CDATA[Angular]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://www.trimagency.com/?p=2695</guid>
		<description><![CDATA[<p>As an Apprentice Product Developer at TRIM, I’ve had the amazing opportunity of working and learning alongside an exceptional team of developers, designers, and strategists. I’m nearing the end of my apprenticeship, and wanted to share a TIL I encountered while working with Angular and TypeScript. Having previous experience in Ruby, Rails, and JavaScript, working [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://old.trimagency.com/styling-select-elements-with-jcf/">Styling Select Elements with JCF</a> appeared first on <a rel="nofollow" href="http://old.trimagency.com">Trim Agency</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>As an Apprentice Product Developer at TRIM, I’ve had the amazing opportunity of working and learning alongside an exceptional team of developers, designers, and strategists. I’m nearing the end of my apprenticeship, and wanted to share a TIL I encountered while working with Angular and TypeScript.</p>
<p>Having previous experience in Ruby, Rails, and JavaScript, working with Angular was different but also eye-opening. It is a lot of fun creating the functionality of a client app with components, modules, and services.</p>
<p>One of my biggest challenges was styling a <code>select</code> dropdown to match our designs. Thankfully the team ( <a href="https://github.com/dominiquemiller">Dom Miller</a>!) created a <a href="https://github.com/TrimAgency/angular-jcf-module">JCF module</a> that can be easily imported into an Angular project.</p>
<p>The <a href="https://github.com/w3co/jcf/blob/master/README.md">JavaScript Custom Forms library</a> (JCF) is a really great tool to customize form elements with CSS.  Once it’s imported to the project, you can place the <code>jcf</code> attribute in the desired element. Adding the attribute will style the element with the default <code>jcf</code> styles.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;select id=“dropdown-example” jcf&gt;
    &lt;option&gt;Pick me&lt;/option&gt;
    &lt;option&gt;No, Pick me!&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>It is possible to include options with the <code>jcf</code> attribute for the <code>select</code> element. I’d like my dropdown to only show three options at a time. That would look something like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;select id=“dropdown-example”         
        jcf='{&quot;maxVisibleItems&quot;: 3}'&gt;
    &lt;option&gt;I’m option 1&lt;/option&gt;
    &lt;option&gt;I’m option 2&lt;/option&gt;
&lt;/select&gt;
</pre>
<p>Now that the default styles and other options are set, we can add in our own styles by selecting and overriding the appropriate <code>jcf</code> classes. To do this, I created a file like this one within my assets folder:</p>
<p><strong>project-name/src/assets/scss/base/_jcf_overrides.scss</strong></p>
<pre class="brush: css; title: ; notranslate">
.jcf-scrollbar-vertical {
 display: none;
}

.jcf-scrollbar-horizontal {
 display: none;
}

.jcf-list .jcf-option {
 font-size: 18px;
 font-weight: bold;
 background-color: $white;
 padding: 11px 20px;
 margin: 0px;
 text-align: left;
 border-top: 1px solid #ccc;
 cursor: pointer;
}
</pre>
<p>You can view the different <code>jcf</code> classes by opening your chrome dev tools on the page where the element is located, and looking near the bottom of the html. You’ll see the <code>jcf</code> classes created by the module.</p>
<p>There you have it! You now have a customized form element.</p>
<p>The post <a rel="nofollow" href="http://old.trimagency.com/styling-select-elements-with-jcf/">Styling Select Elements with JCF</a> appeared first on <a rel="nofollow" href="http://old.trimagency.com">Trim Agency</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://old.trimagency.com/styling-select-elements-with-jcf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
