-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Style Guide #1160
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
Style Guide #1160
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
6d67669
initial style guide prototype with examples
chrisvfritz d6b9552
clarify component style scoping in 3rd-party libs
chrisvfritz 6724067
flesh out rule for complex computed properties
chrisvfritz 8534aa3
clarify component style scoping
chrisvfritz 9b21676
flesh out self-closing components rule in style guide
chrisvfritz 2eabb81
flesh out style guide entry for component name casing in JS/JSX
chrisvfritz c287ba3
complete draft for priority A rules
chrisvfritz d876cf5
complete draft for priority B rules
chrisvfritz 64893a2
style guide fixes after @katiemfritz's review
chrisvfritz d3e1aee
fix code block styles, especially on style guide
chrisvfritz 347239d
fix wrong formatting for in-dom templates style rule
chrisvfritz 9aa668b
simplify data function detailed explanation in style guide
chrisvfritz 92dc6b2
in style guide, add detailed explanation with example for keyed v-for
chrisvfritz 6eec646
in style guide, improve explanation of order of words in component names
chrisvfritz adc571d
in style guide, link to SFC and JSX explanations
chrisvfritz f3afd1f
WIP
chrisvfritz 07eec89
complete definitions for all style guide rules
chrisvfritz bd6e60a
minor language tweaks to style guide
chrisvfritz be1fb07
update SG recommendation for nested component directories, courtesy o…
chrisvfritz e3cba64
fix SG typo in self-closing components example
chrisvfritz 28cbf04
update SG component options order, tag @akryum @posva
chrisvfritz 67c04da
add category tags to rule titles
chrisvfritz d102ae0
style guide round of edits and simplification
chrisvfritz b996b23
move list rendering above conditionals in SG element attribute order
chrisvfritz b1cb4eb
add SG rule about empty lines in component/instance options
chrisvfritz 2d057ae
fixed missing and added commas in SG example
chrisvfritz 7c1c53c
move style guide to its own page
chrisvfritz ed44c39
make exception to multi-word component names for App in SG
chrisvfritz 6559f56
add beta tag to style guide
chrisvfritz 9e89f5e
fix typos pointed out by @phanan
chrisvfritz 2375daa
clarify keyed v-for rule in SG
chrisvfritz 69b4509
update when component subdirectories are worth considering in SG
chrisvfritz b882a59
add link to HTML spec in multi-word component names SG rule
chrisvfritz 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
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<% var isIndex = page.path === 'index.html' %> | ||
|
||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
|
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
<li class="nav-dropdown-container learn"> | ||
<a class="nav-link<%- page.path.match(/(guide(?!\/team.html$)|api|examples|cookbook)/) ? ' current' : '' %>">Learn</a><span class="arrow"></span> | ||
<a class="nav-link<%- page.path.match(/\/(guide(?!\/team.html$)|api|style-guide|examples|cookbook)(\/|$)/) ? ' current' : '' %>">Learn</a><span class="arrow"></span> | ||
<ul class="nav-dropdown"> | ||
<li><ul> | ||
<li><a href="<%- url_for("/v2/guide/") %>" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li> | ||
<li><a href="<%- url_for("/v2/api/") %>" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API</a></li> | ||
<li><a href="<%- url_for("/v2/examples/") %>" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li> | ||
<li><a href="<%- url_for("/v2/guide/") %>" class="nav-link<%- page.path.match(/\/guide(\/|$)/) ? ' current' : '' %>">Guide</a></li> | ||
<li><a href="<%- url_for("/v2/api/") %>" class="nav-link<%- page.path.match(/\/api(\/|$)/) ? ' current' : '' %>">API</a></li> | ||
<li><a href="<%- url_for("/v2/style-guide/") %>" class="nav-link<%- page.path.match(/\/style-guide(\/|$)/) ? ' current' : '' %>">Style Guide</a></li> | ||
<li><a href="<%- url_for("/v2/examples/") %>" class="nav-link<%- page.path.match(/\/examples(\/|$)/) ? ' current' : '' %>">Examples</a></li> | ||
</ul></li> | ||
</ul> | ||
</li> |
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,82 @@ | ||
$style-guide-bad-bg = lighten(desaturate($red, 80%), 80%) | ||
$style-guide-bad-text = darken(desaturate($red, 80%), 20%) | ||
$style-guide-good-bg = lighten(desaturate($green, 80%), 85%) | ||
$style-guide-good-text = darken(desaturate($green, 80%), 10%) | ||
|
||
$style-guide-priority-a-bg = $style-guide-bad-text | ||
$style-guide-priority-a-color = white | ||
$style-guide-priority-b-bg = $style-guide-bad-text | ||
$style-guide-priority-b-color = white | ||
$style-guide-priority-c-bg = steelblue | ||
$style-guide-priority-c-color = white | ||
$style-guide-priority-d-bg = $style-guide-bad-text | ||
$style-guide-priority-d-color = white | ||
|
||
.style-guide | ||
.style-example, details, .style-enforcement | ||
border-radius $radius | ||
margin: 1.6em 0 | ||
padding 1.6em | ||
h4 | ||
margin-top: 0 | ||
figure, p | ||
&:last-child | ||
margin-bottom 0 | ||
padding-bottom 0 | ||
.style-example | ||
&.example-bad | ||
background $style-guide-bad-bg | ||
h4 | ||
color $style-guide-bad-text | ||
&.example-good | ||
background $style-guide-good-bg | ||
h4 | ||
color $style-guide-good-text | ||
details, .style-enforcement | ||
background-color #eee | ||
details | ||
position relative | ||
summary | ||
cursor pointer | ||
padding 1.6em | ||
margin -1.6em | ||
outline none | ||
> h4 | ||
display inline-block | ||
margin 0 | ||
.style-enforcement | ||
table | ||
width 100% | ||
background-color $codebg | ||
border-radius $radius | ||
th, td | ||
padding .4em | ||
text-align center | ||
th | ||
padding-bottom .2em | ||
td | ||
padding-top .2em | ||
.style-rule-tag | ||
background-color $codebg | ||
border-radius $radius | ||
font-size .9em | ||
color $style-guide-good-text | ||
font-weight 600 | ||
text-transform uppercase | ||
padding: .1em .4em | ||
a > .style-rule-tag | ||
color $green | ||
sup | ||
text-transform: uppercase | ||
font-size: .7em | ||
margin-left: 1em | ||
pointer-events: all | ||
position: absolute | ||
[data-p="a"] | ||
color: #6b2a2a | ||
[data-p="b"] | ||
color: #8c480a | ||
[data-p="c"] | ||
color: #2b5a99 | ||
[data-p="d"] | ||
content: #3f536d |
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
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.
It's kind of subjective, but personally I don't think the current background color is a bit too dark to indicate good. Maybe try something like
#dbf1d9
?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.
We can tweak the colors after publishing, but I think this is good enough for now. The specific color you suggested looks very bright to me, like it's trying to highlight something rather than blending into the background. And since the rest of the page is using more subtle, desaturated colors, a more complete overhaul might be necessary to make something like that fit in.