Skip to content

Commit

Permalink
introduce stylelint
Browse files Browse the repository at this point in the history
  • Loading branch information
riophae committed Nov 1, 2017
1 parent 921ad6f commit 20a9a66
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 97 deletions.
76 changes: 39 additions & 37 deletions docs/styles/docs.less
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* stylelint-disable declaration-no-important */

@import "~google-material-color/dist/palette.less";

/* Utils */
Expand Down Expand Up @@ -53,7 +55,7 @@ dl, h1, h2, h3, h4, h5, h6, ol, p, pre, ul {
}

address, dl, ol, p, pre, ul {
margin-bottom: .5em;
margin-bottom: 0.5em;
}

pre, code {
Expand All @@ -62,7 +64,7 @@ pre, code {

code:not([class*="language-"]) {
padding: 2px 3px;
background: rgba(0, 0, 0, .04);
background: rgba(0, 0, 0, 0.04);
border-radius: 3px;
font-size: 12px;
}
Expand All @@ -83,7 +85,7 @@ input[type="radio"] {
margin-right: auto;
}

[class*=container] {
[class*="container"] {
padding-left: 20px;
padding-right: 20px;
}
Expand All @@ -102,12 +104,12 @@ a img {
}

h1, h2, h3, h4 {
color: #2c3e50;
letter-spacing: .5px;
color: #2C3E50;
letter-spacing: 0.5px;
}

h1, h2 {
margin: 1em 0 .45em;
margin: 1em 0 0.45em;
line-height: 1.2;
}

Expand All @@ -126,7 +128,7 @@ h2 {
.site-header {
.vertical-padding(15px);

border-bottom: 1px solid #eee;
border-bottom: 1px solid #EEE;
}

#header {
Expand Down Expand Up @@ -178,13 +180,13 @@ h2 {

.site-header-logo-link {
padding-left: 2em;
background: url(../../static/vue-logo.png) left center no-repeat;
background: url("../../static/vue-logo.png") left center no-repeat;
background-size: 1.5em 1.5em;
font-size: 24px;
font-family: "Dosis", "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
font-family: Dosis, "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
font-weight: 300;
color: rgba(255, 255, 255, .9);
color: #2c3e50;
color: rgba(255, 255, 255, 0.9);
color: #2C3E50;
}

.site-header-logo-component-name {
Expand All @@ -200,8 +202,8 @@ h2 {
.site-header-nav-item {
display: inline-block;
margin-left: 1em;
font-size: .875rem;
color: #34495e;
font-size: 0.875rem;
color: #34495E;
vertical-align: middle;
}

Expand All @@ -212,7 +214,7 @@ h2 {

/* Main */

#main {
#main { // stylelint-disable-line no-duplicate-selectors
padding-top: 3em;

h1 {
Expand All @@ -230,7 +232,7 @@ h2 {
text-decoration: none;

svg {
color: rgba(0, 0, 0, .25);
color: rgba(0, 0, 0, 0.25);
}

svg:hover {
Expand All @@ -254,7 +256,7 @@ p.tip {
position: relative;
margin: 1em 0;
padding: 12px 20px 12px 48px;
background: #f8f8f8;
background: #F8F8F8;
border-radius: 5px;

&::before {
Expand All @@ -268,7 +270,7 @@ p.tip {
width: @size;
height: @size;
border-radius: 50%;
color: #fff;
color: #FFF;
text-align: center;
font-weight: 400;
line-height: @size;
Expand All @@ -281,7 +283,7 @@ p.tip {
margin: 1em 0;
width: 100%;
border-radius: 5px;
border: 1px solid #eee;
border: 1px solid #EEE;

p {
margin: 5px 10px;
Expand All @@ -296,24 +298,24 @@ p.tip {

.example-label {
display: block;
padding: .75em 1em;
padding: 0.75em 1em;
width: 100%;
background: #F8F8F8;
box-sizing: border-box;
color: rgba(0, 0, 0, .6);
color: rgba(0, 0, 0, 0.6);
font-weight: 700;
font-size: 12px;
line-height: 1;
letter-spacing: .5px;
letter-spacing: 0.5px;
text-transform: uppercase;
}

.example-code-lang-switch {
margin-right: -8px;
float: right;
font-weight: 400;
font-size: .9em;
color: #aaa;
font-size: 0.9em;
color: #AAA;
letter-spacing: 0;
}

Expand All @@ -332,23 +334,23 @@ p.tip {
}

.example-demo .example-inner,
.example-code pre[class*="language-"] {
.example-code pre[class*="language-"] {
padding: 15px;
}

.example-demo {
pre.result {
margin: 1em 0;
padding: 1em 1.5em;
background: rgba(0, 0, 0, .025);
background: rgba(0, 0, 0, 0.025);
border: 0;
border-radius: 5px;
font-size: 12px;
}
}

.example-code {
border-left: 1px solid #eee;
border-left: 1px solid #EEE;

.example-inner {
max-height: 300px;
Expand Down Expand Up @@ -383,10 +385,10 @@ pre[class*="language-"] {
right: 0;
top: 0;
padding: 5px 10px 0;
color: #ccc;
font-size: .9em;
color: #CCC;
font-size: 0.9em;
font-weight: 600;
letter-spacing: .5px;
letter-spacing: 0.5px;
}
}

Expand All @@ -410,24 +412,24 @@ table {

thead,
&.striped tr:nth-of-type(2n) {
background: #f8f8f8;
background: #F8F8F8;
}

th {
text-align: left;
font-size: 15px;
font-weight: 400;
letter-spacing: .5px;
letter-spacing: 0.5px;
}

th,
td {
padding: .4em;
border-bottom: 1px solid #eee;
padding: 0.4em;
border-bottom: 1px solid #EEE;
}

tbody tr:hover {
background: #f2f2f2 !important;
background: #F2F2F2 !important;
}
}

Expand Down Expand Up @@ -462,7 +464,7 @@ label input[type="checkbox"] {
}

.sidebar-nav-section-title {
margin-bottom: .6em;
margin-bottom: 0.6em;
font-size: 13px;
font-weight: 600;
text-transform: uppercase;
Expand Down Expand Up @@ -490,8 +492,8 @@ label input[type="checkbox"] {
.vertical-padding(30px);

margin-top: 30px;
border-top: 1px solid #eee;
border-top: 1px solid #EEE;
text-align: center;
font-size: 13px;
letter-spacing: .5px;
letter-spacing: 0.5px;
}
29 changes: 9 additions & 20 deletions docs/styles/prism.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,29 @@ pre[class*="language-"] {
word-wrap: normal;
line-height: 1.5;
font-size: 12px;

-moz-tab-size: 2;
-o-tab-size: 2;
tab-size: 2;

-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}

/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
padding: 28px 28px 20px;
margin: 0.5em 0;
overflow: auto;
background: #F8F8F8;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
margin: 1em 0;
border-radius: 5px;
background: white;
}

pre[class*="language-"] {
background: #f8f8f8;
padding: 28px 28px 20px;
background: #FFF;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
padding: .1em;
border-radius: .3em;
padding: 0.1em;
border-radius: 0.3em;
white-space: normal;
}

Expand All @@ -67,7 +56,7 @@ pre[class*="language-"] {
}

.namespace {
opacity: .7;
opacity: 0.7;
}

.token.property,
Expand All @@ -94,7 +83,7 @@ pre[class*="language-"] {
.token.url,
.language-css .token.string,
.style .token.string {
color: #a67f59;
color: #A67F59;
}

.token.atrule,
Expand All @@ -110,7 +99,7 @@ pre[class*="language-"] {
.token.regex,
.token.important,
.token.variable {
color: #e90;
color: #E90;
}

.token.important,
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"testonly": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run",
"test": "npm run testonly",
"pretest": "npm run lint",
"lint": "eslint --ext .js,.vue .",
"lint:js": "eslint --ext .js,.vue .",
"lint:css": "stylelint '**/*.less'",
"lint": "npm run lint:js && npm run lint:css",
"finish": "npm test && npm run bundle"
},
"dependencies": {
Expand Down Expand Up @@ -90,6 +92,8 @@
"selenium-server": "^3.0.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"stylelint": "^8.2.0",
"stylelint-config-xo-space": "^0.1.0",
"url-loader": "^0.6.2",
"vue": "^2.2.0",
"vue-loader": "^13.0.4",
Expand Down
Loading

0 comments on commit 20a9a66

Please sign in to comment.