<?xml version="1.0" encoding="UTF-8"?>
<rss version='2.0' xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Rhys Lloyd</title>
    <description>.NET Developer, Front End Constructor</description>
    <link>https://justrhysism.silvrback.com/feed</link>
    <atom:link href="https://justrhysism.silvrback.com/feed" rel="self" type="application/rss+xml"/>
    <category domain="justrhysism.silvrback.com">Content Management/Blog</category>
    <language>en-us</language>
      <pubDate>Wed, 25 Jun 2014 20:35:00 -0700</pubDate>
    <managingEditor>justrhysism@gmail.com (Rhys Lloyd)</managingEditor>
      <item>
        <guid>http://blog.rhyslloyd.me/extending-foundation-with-fasten#4796</guid>
          <pubDate>Wed, 25 Jun 2014 20:35:00 -0700</pubDate>
        <link>http://blog.rhyslloyd.me/extending-foundation-with-fasten</link>
        <title>Extend your favourite SASS framework (such as Foundation) with Fasten</title>
        <description>Using the power of SASS to layer your custom template on top of an existing front-end framework</description>
        <content:encoded><![CDATA[<p><strong>Fasten</strong> isn&#39;t a new framework. It&#39;s not a new tool. <em>Fasten is simply a pattern</em>. A pattern to fasten frameworks together and neatly integrate a project&#39;s theme in a maintainable, upgradable way.</p>

<p>Check out <a href="https://github.com/justrhysism/fasten">Fasten on Github</a>.</p>

<hr>

<p>One of the troubles with using an existing SASS/CSS/LESS front-end framework as a base for a project is that as the project evolves, it&#39;s code base gradually steps further and further away from the original framework. Whilst this isn&#39;t necessarily a bad thing, it becomes increasingly difficult to keep the framework up to date with the latest in features, and more importantly; bug fixes.</p>

<p>Realistically, the only way to achieve the goal of <em>easy updating</em>, is if the framework&#39;s codebase isn&#39;t touched at all; not even its settings file, which simply isn&#39;t practical.</p>

<p>Also there&#39;s the challenge of keeping everything as simple and lightweight as possible. Taking a step further, even providing the option of separating certain parts of t CSS into separate files.</p>

<p>Over the last few years, taking inspiration from other blogs suggesting similar patterns (I&#39;ll link to them if I can ever find them), I&#39;ve slowly developed what I believe to be (as close as possible to) the best of both worlds - full customisation of your template, whilst maintaining the core of the base framework untouched.</p>

<p>Personally, <a href="http://foundation.zurb.com/">ZURB&#39;s Foundation</a> is my framework of choice, but the pattern could apply to any, or several, of your preferred frameworks - but I will use Foundation in this example.</p>

<hr>

<p>There are several goals I wanted to achieve:</p>

<ol>
<li>Ability to keep Foundation updated via a package manager (read: <a href="http://bower.io">Bower</a>).</li>
<li>Be selective with which features of Foundation we want to use.</li>
<li>Provide a method of separating out CSS files into &quot;modules&quot;, whilst maintaining full access to global variables, extends and mixins.</li>
<li>Keep the CSS output as lightweight as possible (related to point 2 and 3).</li>
</ol>

<p>Enter <strong>Fasten</strong>. As the name implies, the pattern fastens several parts together, however each of the parts can be upgraded with minimal hassle. </p>

<h2 id="fasten-structure-diagram">Fasten Structure Diagram</h2>

<p>As a visual person, I sketched out a graph to try and piece the platform together, and identify any potential issues. This is the basic idea:</p>

<p><a href="http://justrhysism.github.io/fasten/images/fasten-basic-diagram.svg"><img title="Fasten SASS Structure" alt="Diagram of the Fasten SASS Structure" src="https://silvrback.s3.amazonaws.com/uploads/f795df9f-2a89-4f4a-ad56-39e43f14c899/SASS%20Structure_large.png" /></a></p>

<p><a href="http://justrhysism.github.io/fasten/images/fasten-basic-diagram.svg">View the diagram SVG</a>.</p>

<p>Fasten has several layers to pull everything together in an orderly, manageable manner.</p>

<ol>
<li>Construct</li>
<li>Core

<ol>
<li>Foundation</li>
<li>Vendor</li>
<li>Theme</li>
</ol></li>
<li>Modules

<ol>
<li>Vendor</li>
<li>Theme</li>
</ol></li>
</ol>

<hr>

<h2 id="construct">Construct</h2>

<p>The construct is responsible for keeping the project&#39;s Core and Modules consistent by providing access to common tools, assets and settings. The construct does not contain any styles which helps keep the modules clean of duplicate CSS.</p>

<p>To achieve this, it&#39;s broken up into three primary parts, plus a small configuration file:</p>

<h3 id="toolkit">Toolkit</h3>

<p>The toolkit contains all the project&#39;s mixins and extends.</p>

<h3 id="settings">Settings</h3>

<p>This contains both the framework&#39;s settings as well as the projects settings. Whichever takes precedence will depend on the project.</p>

<p><em>Personally, I prefer to use the Foundation settings as my primary settings file, using a theme settings file for any extra variables I may need.</em></p>

<h3 id="assets">Assets</h3>

<p>The assets part enables Fasten to expose fonts, icons, images and anything else the project might need to share between the Core and Modules. It is important to remember that if the project is using icon fonts, to not include the classes, otherwise these will be duplicated between the Core and the Modules.</p>

<h3 id="configuration">Configuration</h3>

<p>The config file sets where the project&#39;s assets are located using relative paths. This configuration is deliberately separate from settings as it&#39;s designed to be environment specific.</p>

<hr>

<h2 id="core">Core</h2>

<p>The core is the project&#39;s primary styles, including Foundation, any vendor styles, and all the custom theming.</p>

<h3 id="foundation">Foundation</h3>

<p>As mentioned earlier, the project doesn&#39;t need to use Foundation. It could leverage <a href="https://github.com/stowball/Suzi">Suzi</a> or <a href="http://getbootstrap.com/">Bootstrap</a> or whichever framework is best suited.</p>

<p>To keep things neat, and prevent temptation to edit the framework&#39;s source code, use Bower to pull down the framework into the project, and manually import the components it requires. </p>

<p><em>I suggest when starting out to include the absolute bare minimum (e.g. the grid), and only add the components you require as you need them.</em></p>

<h3 id="vendor">Vendor</h3>

<p>By separating vendor code from your code, it will help save confusion among team members as to why the code style is so different, and even ignore those files from your linters until such time you&#39;re able to clean them up.</p>

<p>Vendor files could also import Bower components not dissimilar to how the framework is imported.</p>

<h3 id="theme">Theme</h3>

<p>All the project specific code should be broken up into components within the theme directory. For more complex components, such as navigation menus, it may even be worth bundling these together in a sub-directory to help keep file lengths small and each file concise in its purpose.</p>

<hr>

<h2 id="modules">Modules</h2>

<p>Project modules will be generated into separate CSS files from the core. To help keep the core styles as lightweight as possible, more complex pages should have their styles separated from the core. Of course, if the project is an SPA, modules are probably redundant, and all styles should be included in the core.</p>

<p><em>However, say for example a &quot;standard&quot;website is having a mini web app added which may not always be accessed by the end user, then break that code away into a module.</em></p>

<p>The modules follow a similar pattern to the core. They are made up of vendor and theme code, with the exception of Foundation. However, as the modules do import the construct, they have complete access to Foundation&#39;s and your project&#39;s settings, toolkit and assets.</p>

<hr>

<h2 id="conclusion">Conclusion</h2>

<p>Fasten is a pattern (or framework) for neatly integrating your favourite front-end framework into your project in a manageable and upgradeable manner. It provides a method of breaking the project&#39;s styles into modules, without restricting access to common project settings and assets.</p>

<h2 id="github">Github</h2>

<p><a href="https://github.com/justrhysism/fasten">Fasten is available on Github</a>.</p>
]]></content:encoded>
      </item>
      <item>
        <guid>http://blog.rhyslloyd.me/path-of-least-resistance#4781</guid>
          <pubDate>Tue, 03 Jun 2014 07:23:38 -0700</pubDate>
        <link>http://blog.rhyslloyd.me/path-of-least-resistance</link>
        <title>Path of Least Resistance</title>
        <description>How I arrived at Silvrback</description>
        <content:encoded><![CDATA[<p>It&#39;s quite likely that I will look back and read this post wondering &quot;what was I thinking?&quot; as I looked to pull together a <em>blog</em> so I can share my ideas and learnings with the world.</p>

<p>As a web developer, my typical reaction to such an idea is &quot;I can just build it!&quot; However fortunately of late, I&#39;ve been more and more looking for existing solutions to solve the problems I face.</p>

<p>Naturally my first stop was WordPress. Why wouldn&#39;t it be? WordPress is synonymous with &quot;Blog&quot;. I had even gotten as far as arranging a cheap host and installing WordPress! Since I already owned the domain I wanted to use, I just dialled in the name servers, sat back and waited. And waited.</p>

<p>After a solid 6-7 minutes of waiting (yes, I am well aware that name servers take up to 24 hours to resolve, I&#39;m impatient), I decided that I was sick of waiting so Googled &quot;blog platform&quot;. Straight to result #1 <em><a href="https://medium.com/blogging-and-seo-tips/best-blogging-platforms-of-2014-d62682d9b0aa">Best Blogging Platforms of 2014</a></em>, which had a convenient list of modern blogging platforms with their pros and cons. Lovely! The fact that the article was hosted on one of those platforms was quite fitting, and a little <a href="http://www.urbandictionary.com/define.php?term=meta">meta</a>.</p>

<p>I opened various links in new windows and started to sign up for a couple of different platforms - but it was <a href="http://www.silvrback.com">Silvrback</a> which caught my attention for a couple of reasons:</p>

<ul>
<li>I was able to sign up and start writing <em>this very blogpost</em> within minutes (so meta).</li>
<li>I love a nice clean UI, and even though I actually found the lack of options jarring at first, I&#39;m already starting to warm to it.</li>
<li>Markdown.</li>
<li>Code examples are demonstrated on the introduction page, which is what I intend to use my blog for. Sold.</li>
</ul>

<p>Yeah okay, I&#39;m probably an easy pushover - but I found myself looking for the path of least resistance, and Silvrback is able to provide me with exactly that.</p>
]]></content:encoded>
      </item>
  </channel>
</rss>