<?xml version="1.0"?>
<rss version="2.0"><channel><title>IPS Customization: IPS Customization</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/?d=22</link><description>IPS Customization: IPS Customization</description><language>en</language><item><title>Flexbox</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/flexbox-r4/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">Flexbox</span></strong>
</p>

<p>
	While we've used flexbox in some places in previous versions, 4.5 makes much wider use of it and also introduces a new family of classes. If you aren't familiar with flexbox, I highly recommend <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/" rel="external nofollow" target="_blank">this CSSTricks article</a> for a primer on it. Essentially, instead of positioning elements using floats/clears/etc., flexbox treats the container as a <em>flexible box</em> with properties for controlling how elements inside of it as laid out.
</p>

<p>
	4.5 has a number of new classes that are essentially just convenience for the usual CSS rules.
</p>

<ul><li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex</span> (sets element to display: flex)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-<strong>ai</strong>:start, ipsFlex-<strong>ai</strong>:center, ipsFlex-<strong>ai</strong>:end, ipsFlex-<strong>ai</strong>:stretch</span> (ai - values for align-items property)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-<strong>as</strong>:start, ipsFlex-<strong>as</strong>:center, ipsFlex-<strong>as</strong>:end, ipsFlex-<strong>as</strong>:stretch</span> (as - values for align-self property)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-<strong>jc</strong>:start, ipsFlex-<strong>jc</strong>:center, ipsFlex-<strong>jc</strong>:end, ipsFlex-<strong>jc</strong>:around, ipsFlex-<strong>jc</strong>:between</span> (jc - values for justify-content property)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-<strong>fd</strong>:column, ipsFlex-<strong>fd</strong>:row, ipsFlex-<strong>fd</strong>:column-reverse, ipsFlex-<strong>fd</strong>:row-reverse</span> (fd - values for flex-direction property)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-<strong>fw</strong>:wrap, ipsFlex-<strong>fw</strong>:nowrap, ipsFlex-<strong>fw</strong>:wrap-reverse</span> (fw - values for flex-wrap property)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-flex:10</span> - sets flex-grow: 1 and flex-shrink: 0
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-flex:11</span> - sets flex-grow: 1 and flex-shrink: 1
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-flex:01</span> - sets flex-grow: 0 and flex-shrink: 1
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsFlex-flex:00</span> - sets flex-grow: 0 and flex-shrink: 0
	</li>
</ul><p>
	 
</p>

<p>
	All of these classes have <em>md</em> and <em>sm</em> prefixed versions too, and this opens up the possibility of having different layouts on different device sizes in a way that's <em>much</em> easier than the hoops you'd have to jump through before. For example, to create some elements that show as a row on desktop but collapse to a column on mobile, you'd just apply <span style="font-family:Courier New,Courier,monospace;"><em>ipsFlex ipsFlex-fd:row sm:ipsFlex-fd:column</em></span>. The <span style="font-family:Courier New,Courier,monospace;"><em>sm:ipsFlex-fd:column</em></span> class overrules the <span style="font-family:Courier New,Courier,monospace;"><em>ipsFlex-fd:row</em> </span>class on mobile, adjusting the layout. (Note: flex-direction: row is the CSS default direction anyway, so you can actually leave out <span style="font-family:Courier New,Courier,monospace;"><em>ipsFlex-fd:row</em></span> - it's implicit. I included it in the example for clarity.)
</p>]]></description><guid isPermaLink="false">4</guid><pubDate>Sat, 02 Jan 2021 12:30:10 +0000</pubDate></item><item><title>Font Sizes</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/font-sizes-r5/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">Font sizes</span></strong>
</p>

<p>
	We've moved font sizes to a fixed scale. These have been implemented as theme settings so they are customizable. However, rather than use the theme setting value directly, you should make use of the new <em>{fontsize}</em> plugin. This plugin ensures the global scale is applied to any values passed in, allowing 'large print' versions of themes to be easily created. You should use the <em>{fontsize}</em> plugin for font sizes both when you use one of the theme settings and when you use specific pixel values (e.g. <em>{fontsize="72"} </em>- for 72px text)
</p>

<p>
	When used with the <em>{fontsize}</em> plugin, the type scale keys are:
</p>

<ul><li>
		x_small (12px)
	</li>
	<li>
		small (13px)
	</li>
	<li>
		medium (14px)
	</li>
	<li>
		base (16px)
	</li>
	<li>
		large (18px)
	</li>
	<li>
		x_large (20px)
	</li>
	<li>
		2x_large (24px)
	</li>
	<li>
		3x_large (30px)
	</li>
	<li>
		4x_large (36px)
	</li>
</ul>]]></description><guid isPermaLink="false">5</guid><pubDate>Sat, 02 Jan 2021 12:31:33 +0000</pubDate></item><item><title><![CDATA[CSS Variables & calc]]></title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/css-variables-calc-r6/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">CSS Variables &amp; calc</span></strong>
</p>

<p>
	We're now making use of CSS variables (also known as CSS custom properties). Check out <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties" rel="external nofollow" target="_blank">this MDN article</a> if you aren't familiar with them. This enables us to define some values in one place but use them throughout the product - and it allows you to change the value in one place if you wish to do so for your theme. Most of our CSS variables are defined at the top of <em>global.css</em> in the CSS framework, but you'll also see some other <em>local</em> variables defined in other places. Variables are simply used by wrapping the name in the <em>var()</em> function, e.g. <em>var(--positive-light)</em>. 
</p>

<p>
	You'll see some variables named <span style="font-family:Courier New,Courier,monospace;"><em>--sp-1</em></span> and so on. This is our new 4px spacing scale. In 4.5 and going forward, when we style elements we'll generally be using one of these values for widths, heights, borders, spacing etc. to keep everything consistent. You should do the same for elements you create.
</p>

<p>
	We're also making use of <span style="font-family:Courier New,Courier,monospace;"><em>calc()</em></span>. This is another CSS function that allows math operations to be done. Instead of having to hardcode numbers for positions, sizes etc., we can now use <span style="font-family:Courier New,Courier,monospace;"><em>calc()</em></span> to do it for us based on some other values (often CSS variables).
</p>

<p>
	<strong>CSS Variables for theme settings</strong>
</p>

<p>
	We are deprecating the usage of the {theme} and {hextorgb} tags for color-type theme setting keys (but not for non-color settings or when you need to pass a specific hex code in).
</p>

<p>
	Instead, color-type theme settings will <em>automatically</em> have a CSS variable created for them, named <span style="font-family:Courier New,Courier,monospace;"><em>--theme-setting_key</em></span>, where <em>setting_key</em> is the key of the setting as defined in the <abbr title="Admin Control Panel">AdminCP</abbr>. The variable will be a triplet representing the color, for example <em>255, 255, 255</em>. Therefore, this value can be used with both the <span style="font-family:Courier New,Courier,monospace;">rgb</span> and <span style="font-family:Courier New,Courier,monospace;">rgba</span> CSS color functions.
</p>

<p>
	Here's an example. If in the past you'd wanted to use the <em>area_background</em> theme setting in your CSS, you'd do <span style="font-family:Courier New,Courier,monospace;">background: {theme="area_background"}</span>. Or if you want some opacity, you'd do <span style="font-family:Courier New,Courier,monospace;">background: {hextorgb="area_background" opacity="0.2"}</span>.
</p>

<p>
	In 4.5, the correct way of using these will be: <span style="font-family:Courier New,Courier,monospace;">background: rgb( var(--theme-area_background) )</span> and <span style="font-family:Courier New,Courier,monospace;">background: rgba( var(--theme-area_background), 0.2 )</span> respectively.
</p>

<p>
	We're doing this now because it will open up some exciting functionality in future. To be clear, any existing usage of {theme} and {hextorgb} <strong>will</strong> continue to work fine in 4.5, but we encourage you to move over to the CSS variable approach.
</p>]]></description><guid isPermaLink="false">6</guid><pubDate>Sat, 02 Jan 2021 12:32:26 +0000</pubDate></item><item><title>Padding/margin</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/paddingmargin-r7/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">Padding/margin</span></strong>
</p>

<p>
	We've added new spacing classes for padding and margin, to allow for atomic classnames, device prefixes and modifiers.
</p>

<p>
	ipsPad, ipsPad_double, ipsPad_half, and all of the ipsSpacer_* classes are now deprecated. You'll still see them in our templates and they'll still work in yours, but don't use them in any new work - you should use the updated classes below.
</p>

<p>
	The padding classes are now named ipsPadding:
</p>

<ul><li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding, ipsPadding:none, ipsPadding:half, ipsPadding:double</span> - apply padding to all four sides
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_vertical, ipsPadding_vertical:none, ipsPadding_vertical:half, ipsPadding_vertical:double</span> - apply padding to top and bottom
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_horizontal, ipsPadding_horizontal:none, ipsPadding_horizontal:half, ipsPadding_horizontal:double</span> - apply padding to left and right
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_left, ipsPadding_left:none, ipsPadding_left:half, ipsPadding_left:double</span> - apply padding to the left side (RTL aware)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_right, ipsPadding_right:none, ipsPadding_right:half, ipsPadding_right:double</span> - apply padding to the right side (RTL aware)
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_top, ipsPadding_top:none, ipsPadding_top:half, ipsPadding_top:double</span> - apply padding to the top side
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsPadding_bottom, ipsPadding_bottom:none, ipsPadding_bottom:half, ipsPadding_bottom:double</span> - apply padding to the bottom side
	</li>
</ul><p>
	These classes have <em>md</em> and <em>sm </em>prefixed versions too, allowing you to apply different padding depending on the device size.
</p>

<p>
	One side note here: with the old padding classes, padding was simply halved on phones with no opt-out. That's not the case with the new family - if you <em>want</em> half-padding on mobile on an element, you should apply <span style="font-family:Courier New,Courier,monospace;"><i>sm:ipsPadding:half</i></span> in addition to the normal <span style="font-family:Courier New,Courier,monospace;"><em>ipsPadding</em></span> class, for example. This gives you <em>much</em> more control than you previously had.
</p>

<p>
	Margins follow basically an identical pattern to padding, with the same variation of classes, except the name is <span style="font-family:Courier New,Courier,monospace;"><em>ipsMargin</em></span>.
</p>]]></description><guid isPermaLink="false">7</guid><pubDate>Sat, 02 Jan 2021 12:33:21 +0000</pubDate></item><item><title>Gaps</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/gaps-r8/</link><description><![CDATA[<p>
	<span style="font-size:18px;"><strong>Gaps</strong></span>
</p>

<p>
	Another new family of classes is <span style="font-family:Courier New,Courier,monospace;"><em>ipsGap</em></span>. These classes are used when you want spacing between elements. In the past, you'd have to use :last-child or <span>:first-child to exclude an element, or loop over the elements in the template to leave off a class. If elements wrapped to a new line, putting spacing between the lines was tricky too.</span>
</p>

<p>
	<span><span style="font-family:Courier New,Courier,monospace;"><em>ipsGap</em></span> solves this by applying even spacing between elements, then applying a <em>negative</em> margin on the whole container to bring it back to the starting position.</span>
</p>

<p>
	<span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>The classname is followed by a modifier, which is a number from our spacing scale, e.g. </span><em style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>1</em><span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'> is 4px spacing</span><span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>, </span><em style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>2</em><span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'> is 8px spacing and so on.</span>
</p>

<ul><li>
		<span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'><span style="font-family:Courier New,Courier,monospace;">ipsGap:1</span> (1-5 available) - applies both horizontal and vertical spacing around each element in the container</span>
	</li>
	<li>
		<span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'><span style="font-family:Courier New,Courier,monospace;">ipsGap_row:1</span> (1-5 available, as well as 0 to remove) - applies vertical spacing on each element in the container</span>
	</li>
</ul><p>
	<span style='font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";'>Notice ipsGap_row also supports the :0 modifier. This allows you to have horizontal-only spacing - simply apply <em><span style="font-family:Courier New,Courier,monospace;">ipsGap:1 ipsGap_row:0</span>.</em></span>
</p>

<p>
	Be aware that using both <span style="font-family:Courier New,Courier,monospace;">ipsMargin</span> (or custom styles that apply a margin) and <span style="font-family:Courier New,Courier,monospace;">ipsGap</span> on the same element can cause issues. You may want add a wrapper element to handle your margin in this situation.
</p>]]></description><guid isPermaLink="false">8</guid><pubDate>Sat, 02 Jan 2021 12:34:19 +0000</pubDate></item><item><title>Borders</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/borders-r9/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">Borders</span></strong>
</p>

<p>
	We've also added a class family to add light grey 1px borders to elements - used commonly as dividers between some parts of the page.
</p>

<ul><li>
		<span style="font-family:Courier New,Courier,monospace;">ipsBorder</span> - apply border to all sides
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsBorder:none</span> - remove border from all sides
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsBorder_vertical</span> - apply border to top and bottom
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsBorder_horizontal</span> - apply border to left and right
	</li>
	<li>
		<span style="font-family:Courier New,Courier,monospace;">ipsBorder_top, ipsBorder_bottom, ipsBorder_left, ipsBorder_right</span> - apply border to a particular side
	</li>
</ul><p>
	These classes have md and sm prefixed versions too, to control borders shown on each device size. This is particularly useful if you apply a border to a flex child which is in a row on desktop but a column on desktop, for example - you will be able to easily control which side the border appears on once collapsed.
</p>]]></description><guid isPermaLink="false">9</guid><pubDate>Sat, 02 Jan 2021 12:35:08 +0000</pubDate></item><item><title>Pull Class</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/pull-class-r10/</link><description><![CDATA[<p>
	<span style="font-size:18px;"><strong>"Pull" class</strong></span>
</p>

<p>
	To better display content areas on mobile, a class named <span style="font-family:Courier New,Courier,monospace;"><em>ipsResponsive_pull</em></span> has been added which 'pulls' a box on the left and right sides on small devices. It's intended to be used on boxes (normally with the <span style="font-family:Courier New,Courier,monospace;"><em>ipsBox</em></span> class) that you want to take up the whole screen width on mobile, allowing better usage of the available screen space.
</p>]]></description><guid isPermaLink="false">10</guid><pubDate>Sat, 02 Jan 2021 12:35:56 +0000</pubDate></item><item><title>Class prefixes/modifiers</title><link>https://beta.jimiwikman.se/invision-community/ips-customization/css-framework/class-prefixesmodifiers-r11/</link><description><![CDATA[<p>
	<strong><span style="font-size:18px;">Class prefixes/modifiers</span></strong>
</p>

<p>
	Wait, what's that <em>sm:</em> bit in the atomic classname example above? That's a new naming convention you'll see which controls at which breakpoints the style is applied.
</p>

<ul><li>
		Unprefixed (e.g. <span style="font-family:Courier New,Courier,monospace;"><em>ipsBorder_top</em></span>). Applies to all devices, desktop and smaller.
	</li>
	<li>
		md: (e.g. <span style="font-family:Courier New,Courier,monospace;"><em>md:ipsBorder_top</em></span>). Applies to tablets and smaller.
	</li>
	<li>
		sm: (e.g. <span style="font-family:Courier New,Courier,monospace;"><em>sm:ipsBorder_top</em></span>). Applies to phones only.
	</li>
</ul><p>
	<em>sm </em>and <em>md</em> prefixes take priority over the desktop classname. This means you provide the desktop classname but can <em>override</em> it for tablets and/or phones by also adding an <em>md:</em> or <em>sm:</em> classname. For example, <span style="font-family:Courier New,Courier,monospace;"><em>ipsPadding_top:double sm:ipsPadding_top:half</em></span> applies double top padding on desktop, but only half top padding on phones.
</p>

<p>
	You'll also see modifiers on some classes (as in the example above), for example <span style="font-family:Courier New,Courier,monospace;"><em>ipsPadding:half</em></span>. ipsPadding is saying 'apply padding to all sides', and the ':half' modifier makes it a smaller amount.
</p>]]></description><guid isPermaLink="false">11</guid><pubDate>Sat, 02 Jan 2021 12:37:25 +0000</pubDate></item></channel></rss>
