Skip to content

Commit

Permalink
Rearrange content structure to match wires and start work on colour s…
Browse files Browse the repository at this point in the history
…watches
  • Loading branch information
ediblecode committed Jul 22, 2016
1 parent 37de184 commit d419f26
Show file tree
Hide file tree
Showing 12 changed files with 320 additions and 69 deletions.
2 changes: 1 addition & 1 deletion src/stylesheets/typography/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ a {
}
}

p {
p, .p {
@include nice-font($scale: 0, $line-height: 1.6);
font-feature-settings: 'kern', 'onum', 'liga';
}
33 changes: 33 additions & 0 deletions src/stylesheets/typography/_headings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,42 @@ h3,
h4,
h5,
h6 {
clear: both;
margin: 0;
}

.heading {
clear: both;

&--primary {
@include h1;
}

&--secondary {
@include h2;
}

&--tertiary {
@include h3;
}

&--quaternary {
@include h4;
}

&--quinary {
@include h5;
}

&--senary {
@include h6;
}

&--separator {
border-bottom: 1px solid get-colour(grey);
}
}

h1,
.h1 {
@include h1;
Expand Down
26 changes: 26 additions & 0 deletions web/client/stylesheets/components/_swatch.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.swatch {
border-radius: 999px;
display: block;
float: left;
height: 100px;
line-height: 100px;
margin: 0 8px 8px;
text-align: center;
width: 100px;

@each $name, $palette in $palettes {

@each $key, $hex in $palette {
&--#{$name}-#{$key} {
background: $hex;

&:after {
color: invert($hex);
content: '#{$hex}';
// TODO: Change colour based on hex
}
}
}
}

}
1 change: 1 addition & 0 deletions web/client/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@

// Components
@import 'components/example';
@import 'components/swatch';

// Other
6 changes: 4 additions & 2 deletions web/server/views/404.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

{% block body %}

<h1>Page not found</h1>
<div class="container">
<h1>Page not found</h1>

<p>Sorry, that page could not be found</p>
<p>Sorry, that page could not be found</p>
</div>

{% endblock %}
79 changes: 67 additions & 12 deletions web/server/views/index.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{% extends "layouts/_layout.njk" %}
{% set title = "NICE Bootstrap v2" %}

{% macro item(title, href, description) %}
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="{{ href }}">{{ title }}</a></h4>
<p>
{{ description }}
</p>
</div>
{% endmacro %}

{% block body %}

<div>
Expand All @@ -25,28 +34,74 @@

<div class="container">
<h1>Welcome to NICE Experience</h1>
<h2>Modern, semantic &amp; accessible</h2>
<h2 class="p">Your source for creating beautiful, consistent experiences across NICE</h2>

<h3 class="heading heading--separator">Style Library</h3>

<p>The foundations and patterns that are to be used for faster product development.</p>

<div class="grid">
<div class="grid__item one-whole tablet--one-half desktop--one-third">
<h3>What is it?</h3>

{{ item("Layout", "/style-guide/layout", "Containers, grid and layouts") }}

{{ item("Typography", "/style-guide/typography", "Headings, paragraphs, featured text, quotations, lists, links") }}

{{ item("Buttons", "/style-guide/buttons", "Button text, button blocks") }}

{{ item("Colour", "/style-guide/colour", "Colour contrast, SASS variables, colour palettes") }}

{{ item("Buttons", "/style-guide/buttons", "Button text, button blocks") }}

</div>

<div class="panel">
<h3 class="heading heading--separator">UI Components</h3>

<p>Further patterns</p>

<div class="grid">

{{ item("Breadcrumbs", "/style-guide/breadcrumbs", "Secondary navigation scheme that reveals the user's location") }}

{{ item("Tabs", "/style-guide/tabs", "Content is separated into different panes, with only one pane viewable at a time.") }}

</div>
</div>

<h3 class="heading heading--separator">SASS</h3>

<p>We use SASS as our CSS pre-processor</p>

<div class="grid">
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="/sass/syntax">Syntax</a></h4>
<p>
Syntax and formatting
</p>
</div>
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="/sass/naming">Naming</a></h4>
<p>
Variable naming and BEM convention
</p>
</div>
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="/style-guide/layout">Layout</a></h4>
<p>
It's a modern replacement for <a href="http://nhsevidence.github.io/NICE.Bootstrap/" target="_blank">NICE.Bootstrap</a> and <a href="http://mattonfoot.github.io/NICE.UI/" target="_blank">NICE.UI</a> with improved tooling and documentation, allowing consistent and rapid prototyping for NICE online services and web applications.
Grid unit proportions, gutters and spacing.
</p>
</div>
<div class="grid__item one-whole tablet--one-half desktop--one-third">
<h3>Not just another UI kit&hellip;</h3>
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="/style-guide/colour">Colour</a></h4>
<p>
We haven't re-invented the wheel.
We've used our experience and borrowed &amp; adapted the best bits from <a href="http://getbootstrap.com/" target="_blank">Bootstrap</a> and GOV.UK's <a href="https://github.com/alphagov/govuk_frontend_toolkit" target="_blank">Front End Toolkit</a> &amp; <a href="http://govuk-elements.herokuapp.com/" target="_blank">Elements</a>.
Colour contrast, Sass variables, colour palettes.
</p>
</div>
<div class="grid__item one-whole tablet--one-half desktop--one-third">
<h3>Getting started</h3>
<div class="grid__item one-whole tablet--one-third desktop--one-quarter">
<h4><a href="/style-guide/colour">Colour</a></h4>
<p>
We've made it easy to extend and add to, and equally easy to integrate it into your application.
Colour contrast, Sass variables, colour palettes.
</p>
<a href="#" class="btn">Get started</a>
</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions web/server/views/partials/style-guide-nav.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<nav>
<ul>
<li><a href="/style-guide">Style guide</a></li>
<li><a href="/style-guide/layout">Layout</a></li>
<li><a href="/style-guide/typography">Typography</a></li>
<li><a href="/style-guide/buttons">Buttons</a></li>
<li><a href="/style-guide/colour">Colour</a></li>
</ul>
</nav>
85 changes: 85 additions & 0 deletions web/server/views/style-guide/buttons.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{% extends "../layouts/_sidebar.njk" %}
{% set title = "Buttons" %}

{% block sidebar %}

{% include "partials/style-guide-nav.njk" %}

{% endblock %}


{% block main %}

<h1>Buttons</h1>

<nav>
<ul>
<li><a href="#styles">Styles</a></li>
<li><a href="#sizes">Sizes</a></li>
<li><a href="#groups">Groups</a></li>
</ul>
</nav>

<section id="styles">
<h2>Button styles</h2>

<ul>
<li>Buttons can be <code>&lt;a&gt;</code>, <code>&lt;button&gt;</code> or <code>&lt;input&gt;</code></li>
<li>Use BEM mofifiers for different types</li>
</ul>

{% example -%}
<div class="panel panel--dark">
<p><button type="button" class="btn">Default button</button></p>
<p><a href="#" class="btn btn--primary">Primary button</a></p>
<p><input type="button" class="btn btn--secondary" value="Subtle secondary" /></p>
</div>
{%- endexample %}
</section>

<section id="sizes">
<h2>Sizes</h2>

<ul>
<li>Use BEM modifiers for sizes</li>
<li>Size and type modifiers can be combined</li>
</ul>

{% example -%}
<div class="grid">
<div class="grid__item one-half">
<p><button type="button" class="btn btn--xs">Large button</button></p>
<p><button type="button" class="btn btn--sm">Large button</button></p>
<p><button type="button" class="btn">Default button</button></p>
<p><button type="button" class="btn btn--lg">Large button</button></p>
<p><button type="button" class="btn btn--xl">XL button</button></p>
</div>
<div class="grid__item one-half">
<p><button type="button" class="btn btn--secondary btn--xs">Large button</button></p>
<p><button type="button" class="btn btn--secondary btn--sm">Large button</button></p>
<p><button type="button" class="btn btn--secondary">Default button</button></p>
<p><button type="button" class="btn btn--secondary btn--lg">Large button</button></p>
<p><button type="button" class="btn btn--secondary btn--xl">XL button</button></p>
</div>
</div>
{%- endexample %}
</section>

<section id="groups">
<h2>Groups</h2>

<ul>
<li>Buttons can be grouped together</li>
<li>Typically a default/primary and a secondary</li>
<li>Don't group more than 3 buttons</li>
</ul>

{% example -%}
<p>
<button type="button" class="btn">Primary action</button>
<button type="button" class="btn btn--secondary">Secondary action</button>
</p>
{%- endexample %}
</section>

{% endblock %}
48 changes: 48 additions & 0 deletions web/server/views/style-guide/colour.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{% extends "../layouts/_sidebar.njk" %}
{% set title = "Colour" %}

{% block sidebar %}

{% include "partials/style-guide-nav.njk" %}

{% endblock %}


{% block main %}

<h1>Colours</h1>

<nav>
<ul>
<li><a href="#usage">Usage</a></li>
<li><a href="#palette">Palettes</a></li>
</ul>
</nav>

<section id="usage">
<h2>Usage</h2>

</section>


<section id="groups">
<h2>Palettes</h2>

<h3>Oranges</h3>

<div class="swatch swatch--orange-base"></div>

<h3>Blues</h3>

<div class="swatch swatch--blue-x-light"></div>
<div class="swatch swatch--blue-light"></div>
<div class="swatch swatch--blue-base"></div>
<div class="swatch swatch--blue-dark"></div>

<h3>Purples</h3>

<div class="swatch swatch--purple-base"></div>

</section>

{% endblock %}
25 changes: 0 additions & 25 deletions web/server/views/style-guide/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,6 @@
<p class="lede">
This guide shows how to make your service look consistent with the rest of NICE.
</p>

<div class="grid">
<div class="grid__item one-third lap--one-half palm--one-whole">
<h2><a href="/style-guide/layout">Layout</a></h2>
<p>
Grid unit proportions, gutters and spacing.
</p>
</div>
<div class="grid__item one-third lap--one-half palm--one-whole">
<h2><a href="/style-guide/typography">Typography</a></h2>
<p>
Headings, body text, links, lists, inset text, hidden text.
</p>
</div>
<div class="grid__item one-third lap--one-half palm--one-whole">
<h2><a href="/style-guide/colour">Colour</a></h2>
<p>
Colour contrast, Sass variables, colour palettes.
</p>
</div>
<div class="grid__item one-third lap--one-half palm--one-whole"></div>
<div class="grid__item one-third lap--one-half palm--one-whole"></div>
<div class="grid__item one-third lap--one-half palm--one-whole"></div>
<div class="grid__item one-third lap--one-half palm--one-whole"></div>
</div>
</div>

{% endblock %}
Expand Down
Loading

0 comments on commit d419f26

Please sign in to comment.