Enable stylelint-config-standard, lint CSS files (#1575)

This commit is contained in:
ylemkimon
2018-08-10 02:10:30 +09:00
committed by Erik Demaine
parent eab8f24333
commit e4db097f0c
7 changed files with 73 additions and 54 deletions

View File

@@ -1,5 +1,5 @@
{
//"extends": "stylelint-config-standard",
"extends": "stylelint-config-standard",
"rules": {
"indentation": 4,
}

View File

@@ -4,7 +4,8 @@
* representation instead of the LaTeX source code. (Full selections will
* still produce the LaTeX source code.)
*/
.katex, .katex-display {
.katex,
.katex-display {
user-select: all;
-moz-user-select: all;
-webkit-user-select: all;

View File

@@ -63,7 +63,9 @@
"bin": "cli.js",
"scripts": {
"test": "yarn prestart && yarn test:lint && yarn test:flow && yarn test:jest",
"test:lint": "eslint katex.js katex.webpack.js cli.js webpack.*.js src static test contrib dockers website && stylelint src/katex.less",
"test:lint": "yarn test:lint:js && yarn test:lint:css",
"test:lint:js": "eslint katex.js katex.webpack.js cli.js webpack.*.js src static test contrib dockers website",
"test:lint:css": "stylelint src/katex.less static/main.css contrib/**/*.css website/static/**/*.css",
"test:flow": "flow",
"test:jest": "jest",
"test:jest:watch": "jest --watch",

View File

@@ -1,7 +1,8 @@
/* stylelint-disable font-family-no-missing-generic-family-keyword */
@import "../submodules/katex-fonts/fonts.less";
// The mu unit is defined as 1/18 em
@mu: 1.0/18.0em;
@mu: 1/18em;
@media screen {
.katex {
@@ -20,27 +21,6 @@
}
}
.katex-display {
display: block;
margin: 1em 0;
text-align: center;
> .katex {
display: block;
text-align: center;
white-space: nowrap;
> .katex-html {
display: block;
> .tag {
position: absolute;
right: 0px;
}
}
}
}
.katex {
font: normal 1.21em KaTeX_Main, Times New Roman, serif;
line-height: 1.2;
@@ -135,7 +115,8 @@
font-family: KaTeX_AMS;
}
.mathbb, .textbb {
.mathbb,
.textbb {
font-family: KaTeX_AMS;
}
@@ -143,7 +124,8 @@
font-family: KaTeX_Caligraphic;
}
.mathfrak, .textfrak {
.mathfrak,
.textfrak {
font-family: KaTeX_Fraktur;
}
@@ -151,20 +133,24 @@
font-family: KaTeX_Typewriter;
}
.mathscr, .textscr {
.mathscr,
.textscr {
font-family: KaTeX_Script;
}
.mathsf, .textsf {
.mathsf,
.textsf {
font-family: KaTeX_SansSerif;
}
.mathboldsf, .textboldsf {
.mathboldsf,
.textboldsf {
font-family: KaTeX_SansSerif;
font-weight: bold;
}
.mathitsf, .textitsf {
.mathitsf,
.textitsf {
font-family: KaTeX_SansSerif;
font-style: italic;
}
@@ -181,7 +167,7 @@
// This value is also used in fontMetrics.js, if you change it make sure the
// values match.
@ptperem: 10.0;
@ptperem: 10;
@nulldelimiterspace: 1.2em / @ptperem;
@muspace: 0.055556em; // 1mu
@@ -282,7 +268,7 @@
left: 0;
}
.clap > .inner > span {
.clap > .inner > span {
margin-left: -50%;
margin-right: 50%;
}
@@ -316,7 +302,8 @@
}
}
.sizing, .fontsize-ensurer {
.sizing,
.fontsize-ensurer {
display: inline-block;
@size1: 0.5;
@@ -324,7 +311,7 @@
@size3: 0.7;
@size4: 0.8;
@size5: 0.9;
@size6: 1.0;
@size6: 1;
@size7: 1.2;
@size8: 1.44;
@size9: 1.728;
@@ -335,6 +322,7 @@
&.reset-size@{from}.size@{to} {
@sizeFromVariable: ~"size@{from}";
@sizeToVariable: ~"size@{to}";
font-size: (@@sizeToVariable / @@sizeFromVariable) * 1em;
}
}
@@ -364,6 +352,7 @@
.delim-size1 > span {
font-family: KaTeX_Size1;
}
.delim-size4 > span {
font-family: KaTeX_Size4;
}
@@ -385,6 +374,7 @@
&.small-op {
font-family: KaTeX_Size1;
}
&.large-op {
font-family: KaTeX_Size2;
}
@@ -401,15 +391,15 @@
text-align: center;
}
.accent-body {
position: relative; // so that 'left' can shift the accent
}
// Accents that are not of the accent-full class have zero width
// (do not contribute to the width of the final symbol).
.accent-body:not(.accent-full) {
width: 0;
}
.accent-body {
position: relative; // so that 'left' can shift the accent
}
}
.overlay {
@@ -487,8 +477,8 @@
position: relative;
overflow: hidden;
&:before,
&:after {
&::before,
&::after {
content: "";
}
}
@@ -549,24 +539,49 @@
.boxpad {
padding: 0 0.3em 0 0.3em; // \fboxsep = 3pt
}
.fbox {
box-sizing: border-box;
border: 0.04em solid black; // \fboxrule = 0.4pt
}
.fcolorbox {
box-sizing: border-box;
border: 0.04em solid; // \fboxrule = 0.4pt
}
.cancel-pad {
padding: 0 0.2em 0 0.2em; // ref: cancel package \advance\dimen@ 2\p@ % "+2"
}
.cancel-lap {
margin-left: -0.2em; // \cancel does not affect horizontal spacing.
margin-right: -0.2em; // Apply negative margin to correct for 0.2em padding
} // inside the \cancel group.
.sout {
border-bottom-style: solid;
border-bottom-width: 0.08em;
}
}
.katex-display {
display: block;
margin: 1em 0;
text-align: center;
> .katex {
display: block;
text-align: center;
white-space: nowrap;
> .katex-html {
display: block;
> .tag {
position: absolute;
right: 0;
}
}
}
}

View File

@@ -1,6 +1,6 @@
body {
margin: 0px;
padding: 0px;
margin: 0;
padding: 0;
font-size: 24px;
}
@@ -9,7 +9,7 @@ body {
}
#input {
margin: 0px;
margin: 0;
font-size: 100%;
width: 100%;
box-sizing: border-box;

View File

@@ -1,6 +1,6 @@
.onPageNav ul li,
.onPageNav ul ul li {
padding-bottom: 0px; /* moved to ul ul, ul a, ul ul a */
padding-bottom: 0; /* moved to ul ul, ul a, ul ul a */
}
.onPageNav ul ul {
@@ -26,6 +26,7 @@
height: 80%;
}
/* stylelint-disable block-no-empty */
@media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
}

View File

@@ -4,7 +4,7 @@ body {
}
b {
font-weight: bolder;
font-weight: bolder;
}
.container {
@@ -13,7 +13,8 @@ b {
max-width: 800px;
}
.header, .footer {
.header,
.footer {
color: #fff;
background: #329894;
overflow: hidden;
@@ -63,17 +64,14 @@ b {
background: rgba(255, 255, 255, 0.1);
}
.demo {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
font-size: 22px;
margin: 50px 0 0;
}
.demo {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
font-size: 22px;
margin: 50px 0 0;
}
.demo-left,
@@ -184,6 +182,7 @@ b {
padding-top: 50px;
}
/* stylelint-disable-next-line no-descending-specificity */
.main .cta a {
border: 3px solid;
color: #329894;
@@ -212,6 +211,7 @@ b {
font-size: 16px;
}
/* stylelint-disable-next-line no-descending-specificity */
.credits a {
color: white;
}