Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ITCSS improvements and automatics style guide generation #112

Merged
merged 36 commits into from Feb 13, 2017
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5969a6d
Updating ITCSS structure according inuitcss
luboskmetko Nov 15, 2016
baeb766
Fixing ITCSS test
luboskmetko Nov 15, 2016
444c36a
Adding sample templates for elements, objects and components
luboskmetko Nov 15, 2016
efd0691
Removing sidebar code sample as it's not a good example of component
luboskmetko Nov 15, 2016
c5c9701
Adding style guide stying and additional elements
luboskmetko Nov 16, 2016
9dcd3f9
Adding remaining objects
luboskmetko Nov 16, 2016
720a5eb
Adding simple layout system
luboskmetko Nov 16, 2016
099f793
Updating layout object for smaller resolutions
luboskmetko Nov 16, 2016
22f11b4
Fixing spacing unit in spacing utility
luboskmetko Nov 16, 2016
7cda280
Renaming files and test accordingly
luboskmetko Nov 18, 2016
1759b06
Renaming style guide so it's generated as a regular page
luboskmetko Nov 18, 2016
5083ecc
Extending style guide from base layout
luboskmetko Nov 18, 2016
a909bac
Renaming component file name to match component name
luboskmetko Nov 18, 2016
d285407
Testing creation of new templates
luboskmetko Nov 18, 2016
b68f619
Adding style guide to project index
luboskmetko Nov 18, 2016
376cf63
Fixing HTML validation error in images element
luboskmetko Nov 18, 2016
ff7701d
Copying Twig templates to WP theme
luboskmetko Nov 21, 2016
0fc3fec
Merging WP base template with front-end one
luboskmetko Nov 21, 2016
c28a9d6
Fixing conflicts
luboskmetko Jan 25, 2017
4981e69
Fixing WP test
luboskmetko Jan 25, 2017
78392ec
Fixing remaining WP tests
luboskmetko Jan 25, 2017
716136e
Using revisionePath on styles
luboskmetko Jan 25, 2017
a564ae3
Fixing scripts and styles path in base template
luboskmetko Jan 27, 2017
a775775
Adding header component
luboskmetko Jan 27, 2017
ed9c3fc
Improving footer component styling
luboskmetko Jan 27, 2017
220f133
Removing HTML header (it's in base template now)
luboskmetko Jan 27, 2017
1068b85
Moving to tease templates to components
luboskmetko Jan 27, 2017
a105bb8
Moving to tease templates to components
luboskmetko Jan 27, 2017
242ba22
Adding main navigation component
luboskmetko Jan 27, 2017
675736a
Removing sidebar from WP templates
luboskmetko Jan 30, 2017
ab3f7c7
Adding comment and comment for components
luboskmetko Jan 30, 2017
6743306
Displaying info about no comments
luboskmetko Jan 30, 2017
96089ae
Adding a note about moderation
luboskmetko Jan 30, 2017
3304822
Adding default WP styles for images
luboskmetko Jan 30, 2017
76e7f7e
Moving styles for WP only components to the WP generator
luboskmetko Jan 30, 2017
e3afcfe
Renaming style guide in WP projects so it works as a page
luboskmetko Jan 30, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,60 @@
/* ==========================================================================
#BUTTONS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's change this to components/_btn.scss?
I like having the component name corresponding with its filename

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea

========================================================================== */

/**
* This is an example component. Extend inuitcss by building your own components
* that make up your UI. Component classes are prefixed with a `c-`.
*/

/**
* 1. Allow us to style box model properties.
* 2. Line different sized buttons up a little nicer.
* 3. Make buttons inherit font styles (often necessary when styling `input`s as
* buttons).
* 4. Reset/normalize some styles.
* 5. Force all button-styled elements to appear clickable.
*/

.c-btn {
display: inline-block; /* [1] */
vertical-align: middle; /* [2] */
font: inherit; /* [3] */
text-align: center; /* [4] */
margin: 0; /* [4] */
cursor: pointer; /* [5] */
padding: 0.5rem 1rem;
transition: $global-transition;
border-radius: $global-radius;
}

/* Style variants
========================================================================== */

.c-btn--primary {
background-color: $color-link;

&,
&:hover,
&:active,
&:focus {
text-decoration: none; /* [4] */
color: $color-white;
}

&:hover,
&:focus {
background-color: $color-hover;
}
}

/* Size variants
========================================================================== */

.c-btn--small {
padding: 0.25rem 0.5rem;
}

.c-btn--large {
padding: 0.75rem 1.5rem;
}
@@ -0,0 +1,10 @@
/* ==========================================================================
#FOOTER
========================================================================== */

.c-footer {
border-top: 1px solid $color-border;
font-size: 0.875rem;
margin-top: 2rem;
padding-top: 0.5em;
}
@@ -0,0 +1,55 @@
/* ==========================================================================
#STYLEGUIDE
========================================================================== */

$style-guide-color-medium: #666;
$style-guide-color-light: #999;
$style-guide-color-border: #ccc;

.c-style-guide__intro {
border: 1px solid $style-guide-color-border;
border-bottom-width: 2px;
border-right-width: 2px;
margin: 2em 0 1em 0;
padding: 2em;
}

.c-style-guide__title {
color: $style-guide-color-medium;
font-size: 1.25rem;
font-weight: normal;
margin: 0 0 0.25em 0;
text-transform: uppercase;
}

.c-style-guide__desc {
color: $style-guide-color-medium;
margin: 0;
}

.c-style-guide__section {
@include clearfix();
padding: 1rem 0;
}

.c-style-guide__section-title {
border-bottom: 1px solid $style-guide-color-border;
clear: both;
color: $style-guide-color-medium;
font-size: 1.25rem;
font-weight: normal;
padding-bottom: 0.5em;
text-transform: uppercase;
width: 50%;
}

.c-style-guide__section-subtitle {
border-left: 6px solid $style-guide-color-border;
clear: both;
color: $style-guide-color-light;
font-size: 1.125rem;
font-weight: normal;
margin: 2em 0;
padding-left: 1em;
text-transform: uppercase;
}
7 changes: 0 additions & 7 deletions generators/app/templates/styles/itcss/components/_footer.scss

This file was deleted.

5 changes: 0 additions & 5 deletions generators/app/templates/styles/itcss/components/_layout.scss

This file was deleted.

@@ -0,0 +1,33 @@
/* ==========================================================================
#HEADINGS
========================================================================== */

/**
* Simple default styles for headings 1 through 6. Anything more opinionated
* than simple font-size changes should likely be applied via classes (see:
* http://csswizardry.com/2016/02/managing-typography-on-large-apps/).
*/

h1 {
font-size: 2.25rem;
}

h2 {
font-size: 1.75rem;
}

h3 {
font-size: 1.5rem;
}

h4 {
font-size: 1.25rem;
}

h5 {
font-size: 1.125rem;
}

h6 {
font-size: 1rem;
}
@@ -0,0 +1,7 @@
/* ==========================================================================
#HR
========================================================================== */

hr {
display: block;
}
@@ -0,0 +1,28 @@
/* ==========================================================================
#IMAGES
========================================================================== */

/**
* 1. Fluid images for responsive purposes.
* 2. Offset `alt` text from surrounding copy.
* 3. Setting `vertical-align` removes the whitespace that appears under `img`
* elements when they are dropped into a page as-is. Safer alternative to
* using `display: block;`.
*/

img {
font-style: italic; /* [2] */
max-width: 100%; /* [1] */
vertical-align: middle; /* [3] */
}


/**
* 1. If a `width` and/or `height` attribute have been explicitly defined, let’s
* not make the image fluid.
*/

img[width], /* [1] */
img[height] { /* [1] */
max-width: none;
}
@@ -0,0 +1,12 @@
/* ==========================================================================
#LINKS
========================================================================== */

a {
color: $color-link;
text-decoration: underline;

&:hover {
color: $color-hover;
}
}
@@ -1,4 +1,6 @@
// Lists
/* ==========================================================================
#LISTS
========================================================================== */

li {
margin-bottom: 0.5rem;
Expand Down
37 changes: 37 additions & 0 deletions generators/app/templates/styles/itcss/elements/_elements.page.scss
@@ -0,0 +1,37 @@
/* ==========================================================================
#PAGE
========================================================================== */

/**
* Simple page-level setup.
*
* 1. Set the default `font-size` and `line-height` for the entire project.
* 2. Force scrollbars to always be visible to prevent awkward ‘jumps’ when
* navigating between pages that do/do not have enough content to produce
* scrollbars naturally.
* 3. Ensure the page always fills at least the entire height of the viewport.
*/

html {
background: $color-bg;
color: $color-text;
font-family: $font-sans-serif;
font-size: 0.8125rem; /* [1] */ /* 13px */
line-height: 1.5; /* [1] */
min-height: 100%; /* [3] */
overflow-y: scroll; /* [2] */
padding: 1rem;

@include bp-medium {
font-size: 0.875em; /* 14px */
}

@include bp-large {
font-size: 0.9375em; /* 15px */
}

@include bp-full {
font-size: 1em; /* 16px */
}
}

@@ -0,0 +1,11 @@
/* ==========================================================================
#TABLES
========================================================================== */

/**
* 1. Ensure tables fill up as much space as possible.
*/

table {
width: 100%; /* [1] */
}
16 changes: 0 additions & 16 deletions generators/app/templates/styles/itcss/elements/_headings.scss

This file was deleted.

9 changes: 0 additions & 9 deletions generators/app/templates/styles/itcss/elements/_hr.scss

This file was deleted.

10 changes: 0 additions & 10 deletions generators/app/templates/styles/itcss/elements/_links.scss

This file was deleted.

26 changes: 0 additions & 26 deletions generators/app/templates/styles/itcss/elements/_page.scss

This file was deleted.

17 changes: 0 additions & 17 deletions generators/app/templates/styles/itcss/generic/_box-sizing.scss

This file was deleted.

@@ -0,0 +1,20 @@
/* ==========================================================================
#BOX-SIZING
========================================================================== */

/**
* More sensible default box-sizing:
* css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice
*/

html {
box-sizing: border-box;
}

* {
&,
&:before,
&:after {
box-sizing: inherit;
}
}
@@ -0,0 +1,5 @@
/* ==========================================================================
#NORMALIZE
========================================================================== */

@import 'normalize-scss/sass/normalize/import-now';