##The Big Silver SKO Box
An SKO and Redhat Logo lockup resizable outfit template
https://redhat.outfit.io/templates/191/repository_files/index.html.mst
##What does it do?
Scalable fonts for any dimension or size has been taken care of for you using vminvmax. Custom media queries for different aspect ratios have been created in PostCSS and cssnext. cssnext also has support for native css varibles. PostCSS also autoprefixes your css if a prefix is required. suck it -webkit.
Finally all of your mustache variables are filled with data and a built version is able to be previewed in your browser on port 8080 by node-static.
##Hold on a sec buddy.
Before you start you need to have node and npm installed. Installing Node.js and updating npm
##Setting it up.
-
Clone this Repository:
git clone git@github.com:RedHatBrand/SKOGenericResizable.git -
Navigate to the repo directory:
cd SKOGenericResizable -
Create build folder:
mkdir -p build/assets/stylesheets && mkdir -p build/assets/javascripts -
npm install -
npm run serve -
Template should be accessible at http://localhost:8080
##Using this template:
###File Structure
- The
/srcdirectory is where your working files are and will be the files you edit, they get compiled to the/builddirectory when the server is running. - Any time you change a file in the
/srcfolder, the build will run again, recompiling your assets.
###Outfit Inputs
-
Outfit uses the mustache logicless templating language for creating Outfit Inputs. These are what
authorsuse to input data into the template. -
The
src/data.jsonfile is where the dummy data for your outfit variables will be storedA Basic Outfit variable in
src/index.mst:<h1>{{ headline }}</h1>The corresponding data in
src/data.json:{ "headline": "My Headline" }Built html file in
build/index.html:<h1>My Headline</h1> -
All mustache tags (
{{ }}) inside the template must be inside thesrc/index.mstfile, any tags in other files will be ignored (and probably thow you a big fat error), so if you need to add mustache tags tocssorjsfiles for whatever reason, they must be in theindex.mst.Example Mustache tags in javascript:
<script type="text/javascript"> var foo = {{ bar }} </script>Example Mustache tags in CSS:
<style type="text/css"> .foo { color: {{ bar }}; } </style>
-
Different types of mustache tags
There are a few different types of mustache tags and a few special ones unique to outfit, These are the most used.-
{{ foo }}
Standard Mustache tag (will escape special characters) -
{{{ foo }}}
Standard Mustache tag (will not escape special characters) -
{{# foo }} <h1>bar</h1> {{/ foo }}
Only print<h1>bar</h1>if there is data forfoo. -
{{^ foo }} <h1>bar</h1> {{/ foo }}
Only print<h1>bar</h1>if there is no content forfoo.
-
##Importing the template into outfit
-
Copy the contents of
src/index.mst -
Edit the contents of
index.html.mstin the outfit repo and paste in the code that you copied fromsrc/index.mst -
Copy contents of the files in
/build/assetsand create corresponding directories and files in outfit. -
Navigate to the Inputs tab and fill out the missing ones
-
Booyah.