-
Notifications
You must be signed in to change notification settings - Fork 0
Finish CSS Basics #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
aefe316
Adds config for custom theme font
88eb49e
Adds Sass for easier, better theming
62d0efb
Adds scss linting
37148af
Lint test
fa51eb1
Lint test
e259f17
Finish lint testing
5bfcd5e
Live by the comment I'd just written
1c87c38
Fix breakpoint include
402870b
Small ordering tweaks
a6e376c
Update readme
dfd95f4
Adds open source CSS basics with sample 'styleguide' page
73f1632
Adds more sample components
8303035
Update Readme
0860ff0
webpack config cleaning
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
scss_files: './' | ||
exclude: [ | ||
'./node_modules/**/*', | ||
] | ||
|
||
linters: | ||
|
||
BangFormat: | ||
enabled: true | ||
space_before_bang: true | ||
space_after_bang: false | ||
|
||
BorderZero: | ||
enabled: true | ||
|
||
ColorKeyword: | ||
enabled: false | ||
|
||
ColorVariable: | ||
enabled: false | ||
|
||
Comment: | ||
enabled: false | ||
|
||
DebugStatement: | ||
enabled: true | ||
|
||
DeclarationOrder: | ||
enabled: true | ||
|
||
DuplicateProperty: | ||
enabled: false | ||
|
||
ElsePlacement: | ||
enabled: true | ||
style: same_line | ||
|
||
EmptyLineBetweenBlocks: | ||
enabled: true | ||
ignore_single_line_blocks: false | ||
|
||
EmptyRule: | ||
enabled: true | ||
|
||
FinalNewline: | ||
enabled: true | ||
present: true | ||
|
||
HexLength: | ||
enabled: true | ||
style: short | ||
|
||
HexNotation: | ||
enabled: true | ||
style: lowercase | ||
|
||
HexValidation: | ||
enabled: true | ||
|
||
IdSelector: | ||
enabled: true | ||
|
||
ImportPath: | ||
enabled: true | ||
leading_underscore: false | ||
filename_extension: false | ||
|
||
Indentation: | ||
enabled: true | ||
character: space | ||
width: 2 | ||
|
||
LeadingZero: | ||
enabled: true | ||
style: include_zero | ||
|
||
MergeableSelector: | ||
enabled: false | ||
force_nesting: false | ||
|
||
NameFormat: | ||
enabled: true | ||
convention: hyphenated_lowercase | ||
allow_leading_underscore: true | ||
|
||
NestingDepth: | ||
enabled: true | ||
max_depth: 3 | ||
|
||
PlaceholderInExtend: | ||
enabled: true | ||
|
||
PropertySortOrder: | ||
enabled: false | ||
ignore_unspecified: false | ||
|
||
PropertySpelling: | ||
enabled: true | ||
extra_properties: ['text-size-adjust'] | ||
|
||
QualifyingElement: | ||
enabled: true | ||
allow_element_with_attribute: true | ||
allow_element_with_class: false | ||
allow_element_with_id: false | ||
|
||
SelectorDepth: | ||
enabled: true | ||
max_depth: 3 | ||
|
||
SelectorFormat: | ||
enabled: true | ||
convention: hyphenated_BEM | ||
class_convention: '^[a-z][a-z0-9-]*(?:__[a-z][a-z0-9-]*)?(?:--[a-z][a-z0-9-]*)?$' | ||
id_convention: 'a^' # Regular expression aiming at failing all the time, so that ID are actually forbidden | ||
ignored_names: ['veeseoLogo', 'veeseoRA2VW2', 'imageContainer'] | ||
|
||
Shorthand: | ||
enabled: true | ||
|
||
SingleLinePerProperty: | ||
enabled: true | ||
allow_single_line_rule_sets: false | ||
|
||
SingleLinePerSelector: | ||
enabled: false | ||
|
||
SpaceAfterComma: | ||
enabled: true | ||
|
||
SpaceAfterPropertyColon: | ||
enabled: true | ||
style: one_space | ||
|
||
SpaceAfterPropertyName: | ||
enabled: true | ||
|
||
SpaceBeforeBrace: | ||
enabled: true | ||
style: space | ||
allow_single_line_padding: true | ||
|
||
SpaceBetweenParens: | ||
enabled: true | ||
spaces: 0 | ||
|
||
StringQuotes: | ||
enabled: true | ||
style: single_quotes | ||
|
||
TrailingSemicolon: | ||
enabled: true | ||
|
||
TrailingZero: | ||
enabled: true | ||
|
||
UnnecessaryMantissa: | ||
enabled: true | ||
|
||
UnnecessaryParentReference: | ||
enabled: true | ||
|
||
UrlFormat: | ||
enabled: false | ||
|
||
UrlQuotes: | ||
enabled: true | ||
|
||
VendorPrefixes: | ||
enabled: true | ||
identifier_list: base | ||
excluded_identifiers: [] | ||
|
||
ZeroUnit: | ||
enabled: true |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
$breakpoint-small: 900px !default; | ||
$breakpoint-sidebar: 600px !default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// Warning: Make sure this manifest never outputs CSS | ||
// and only import variables, mixins, functions etc. | ||
// as this file is included in _every_ component | ||
// | ||
@import 'mixins'; | ||
@import 'breakpoints'; | ||
@import 'layout'; | ||
@import 'colors'; | ||
@import 'typography'; | ||
@import 'overrides'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
$container-max-width: 1200px; | ||
|
||
$spacing-gutter: 20px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/// | ||
/// Viewport sized typography with minimum and maximum values | ||
/// | ||
/// @author Eduardo Boucas (@eduardoboucas) | ||
/// | ||
/// @param {Number} $responsive - Viewport-based size | ||
/// @param {Number} $min - Minimum font size (px) | ||
/// @param {Number} $max - Maximum font size (px) | ||
/// (optional) | ||
/// @param {Number} $fallback - Fallback for viewport- | ||
/// based units (optional) | ||
/// | ||
/// @example scss - 5vw font size (with 50px fallback), | ||
/// minumum of 35px and maximum of 150px | ||
/// @include responsive-font(5vw, 35px, 150px, 50px); | ||
/// | ||
@mixin responsive-font($responsive, $min, $max: false, $fallback: false) { | ||
$responsive-unitless: $responsive / ($responsive - $responsive + 1); | ||
$dimension: if(unit($responsive) == 'vh', 'height', 'width'); | ||
$min-breakpoint: $min / $responsive-unitless * 100; | ||
|
||
@media (max-#{$dimension}: #{$min-breakpoint}) { | ||
font-size: $min; | ||
} | ||
|
||
@if $max { | ||
$max-breakpoint: $max / $responsive-unitless * 100; | ||
|
||
@media (min-#{$dimension}: #{$max-breakpoint}) { | ||
font-size: $max; | ||
} | ||
} | ||
|
||
@if $fallback { | ||
font-size: $fallback; | ||
} | ||
|
||
font-size: $responsive; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@import 'globals'; | ||
|
||
.root { | ||
font-family: $font-primary; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import styles from './container.scss'; | ||
|
||
const Button = ({ children, text, type }) => ( | ||
<button type={type || 'button'} className={styles.root}> | ||
{children || text} | ||
</button> | ||
); | ||
|
||
export default Button; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
@import 'globals'; | ||
|
||
.root { | ||
display: block; | ||
text-align: center; | ||
padding: 0.75em 1em; | ||
border-radius: 4px; | ||
text-decoration: none; | ||
text-transform: uppercase; | ||
font-family: $font-primary; | ||
color: $color-button-primary-text; | ||
background-color: $color-button-primary-bg; | ||
letter-spacing: $heading-2-letter-spacing; | ||
} | ||
|
||
.root:hover, | ||
.root:active, | ||
.root:focus { | ||
background-color: $color-button-primary-bg-hover; | ||
color: $color-button-primary-text-hover; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import styles from './button-link.scss'; | ||
|
||
const ButtonLink = ({ children, text, href }) => ( | ||
<a href={href || '#'} className={styles.root}> | ||
{children || text} | ||
</a> | ||
); | ||
|
||
export default ButtonLink; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.root::after { | ||
content: ''; | ||
display: table; | ||
clear: both; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
import styles from './container.scss'; | ||
|
||
const Clearfix = ({ children }) => ( | ||
<div className={styles.root}> | ||
{children} | ||
</div> | ||
); | ||
|
||
export default Clearfix; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a slightly different approach on CEVT where I only included relevant dependencies in each component rather than all of them. Slightly more work but also more explicit and synced with the JS way of doing.
E.g.: https://github.com/edenspiekermann/cevt/blob/master/assets/sass/components/_button.scss#L1-L2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I may get to this, looks a bit cleaner and consistent. But for now this setup is working :)