@_nu/html-validator
Advanced tools
+28
-1
@@ -1,2 +0,2 @@ | ||
| ## 0.0.1 (2019-11-18) | ||
| ## [0.0.6](https://github.com/nu-system/html-validator/compare/v0.0.4...v0.0.6) (2019-11-19) | ||
@@ -6,2 +6,29 @@ | ||
| * remove level3 ([5a8f577](https://github.com/nu-system/html-validator/commit/5a8f5775c68f274baf74fee3465f187423d33974)) | ||
| ## [0.0.4](https://github.com/nu-system/html-validator/compare/v0.0.3...v0.0.4) (2019-11-19) | ||
| ### Features | ||
| * 隐藏head 内标签本身文案 ([fa8553a](https://github.com/nu-system/html-validator/commit/fa8553a7e3d6f0b9cb8262ddf1a557c871b304bc)) | ||
| ## [0.0.3](https://github.com/nu-system/html-validator/compare/v0.0.2...v0.0.3) (2019-11-18) | ||
| ## [0.0.2](https://github.com/nu-system/html-validator/compare/baf50b8c5dc4b21fae26262824f9cf4b019f3563...v0.0.2) (2019-11-18) | ||
| ### Bug Fixes | ||
| * change the link of demo ([e487a6b](https://github.com/nu-system/html-validator/commit/e487a6bcc21e6be6ac62d26bc55cad8eab67e2fb)) | ||
| ### Features | ||
| * change name form lint to validator ([baf50b8](https://github.com/nu-system/html-validator/commit/baf50b8c5dc4b21fae26262824f9cf4b019f3563)) | ||
@@ -8,0 +35,0 @@ |
+38
-40
@@ -15,4 +15,2 @@ /* | ||
| line-height: 0; | ||
| outline: 1px solid #000000; | ||
| margin: 8px; | ||
| } | ||
@@ -27,4 +25,4 @@ /* | ||
| } | ||
| html:not([lang])::before, | ||
| html[lang=""]::before { | ||
| html:not([lang]):not([data-hvi])::before, | ||
| html[lang=""]:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -44,5 +42,5 @@ background-color: var(--c-level1); | ||
| } | ||
| style:empty::before, | ||
| script:not([src]):empty::before, | ||
| title:empty::before { | ||
| style:empty:not([data-hvi])::before, | ||
| script:not([src]):empty:not([data-hvi])::before, | ||
| title:empty:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -57,21 +55,21 @@ background-color: var(--c-level1); | ||
| } | ||
| [style=""], | ||
| [title=""], | ||
| [id=""], | ||
| [src=""], | ||
| [href=""], | ||
| [name=""], | ||
| [for=""], | ||
| [type=""], | ||
| [width=""], | ||
| [height=""] { | ||
| [style=""]:not([data-hvi]), | ||
| [title=""]:not([data-hvi]), | ||
| [id=""]:not([data-hvi]), | ||
| [src=""]:not([data-hvi]), | ||
| [href=""]:not([data-hvi]), | ||
| [name=""]:not([data-hvi]), | ||
| [for=""]:not([data-hvi]), | ||
| [type=""]:not([data-hvi]), | ||
| [width=""]:not([data-hvi]), | ||
| [height=""]:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'Those props should not empty'; | ||
| } | ||
| abbr:not([title]) { | ||
| abbr:not([title]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<abbr> needs [title="…"]'; | ||
| } | ||
| a[target]:not([rel*="noopener"]), | ||
| a[target]:not([rel*="noreferrer"]) { | ||
| a[target]:not([rel*="noopener"]):not([data-hvi]), | ||
| a[target]:not([rel*="noreferrer"]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -81,12 +79,12 @@ content: '[target="…"] also needs [rel="noopener"] or [rel="noopener noreferrer"]'; | ||
| /* figure */ | ||
| :not(figure) > figcaption { | ||
| :not(figure) > figcaption:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<figcaption> must be a child of <figure>"; | ||
| } | ||
| figure > figcaption:not(:first-child):not(:last-child), | ||
| figure > figcaption:not(:first-child):not(:last-child) ~ :last-child:not(figcaption) { | ||
| figure > figcaption:not(:first-child):not(:last-child):not([data-hvi]), | ||
| figure > figcaption:not(:first-child):not(:last-child) ~ :last-child:not(figcaption):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<figcaption> must be first/last child of <figure>"; | ||
| } | ||
| figure > figcaption:not(:first-of-type) { | ||
| figure > figcaption:not(:first-of-type):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -96,13 +94,13 @@ content: "<figure> should only contain one <figcaption>"; | ||
| /* ul/ol */ | ||
| :not(ul):not(ol) > li { | ||
| :not(ul):not(ol) > li:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<li> is missing a parent <ul> or <ol>"; | ||
| } | ||
| ol > :not(li), | ||
| ul > :not(li) { | ||
| ol > :not(li):not([data-hvi]), | ||
| ul > :not(li):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "Immediate child of <ol> or <ul> must be <li>"; | ||
| } | ||
| :not(dl) dd, | ||
| :not(dl) dt { | ||
| :not(dl) dd:not([data-hvi]), | ||
| :not(dl) dt:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -112,3 +110,3 @@ content: "<dd> or <dt> is missing a parent <dl> or <div>"; | ||
| /* dl */ | ||
| dl > :not(dt):not(dd):not(div) { | ||
| dl > :not(dt):not(dd):not(div):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -118,16 +116,16 @@ content: "Immediate child of <dl> must be <dt>, <dd>, or <div>"; | ||
| /* form */ | ||
| fieldset > :not(legend):first-child { | ||
| fieldset > :not(legend):first-child:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "Invalid: first-child of <legend>"; | ||
| } | ||
| :not(fieldset) > legend, | ||
| fieldset > legend:not(:first-child) { | ||
| :not(fieldset) > legend:not([data-hvi]), | ||
| fieldset > legend:not(:first-child):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<legend> must be: first-child of <fieldset>"; | ||
| } | ||
| input[type="radio"]:not([name]) { | ||
| input[type="radio"]:not([name]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'Radios without name="…"'; | ||
| } | ||
| form button:not([type]) { | ||
| form button:not([type]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -137,18 +135,18 @@ content: '<button> in <form> need [type="…"]'; | ||
| /* dom */ | ||
| a a { | ||
| a a:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<a/> should not be the kids of <a/>'; | ||
| } | ||
| p div, | ||
| p + div:not(:empty) + p:empty { | ||
| p div:not([data-hvi]), | ||
| p + div:not(:empty) + p:empty:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<div> is not allowed within <p>'; | ||
| } | ||
| :not(svg) [href]:not(a):not(link):not(area) { | ||
| :not(svg) [href]:not(a):not(link):not(area):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'attribute href not allowed on this element'; | ||
| } | ||
| [target]:not(a):not(form) { | ||
| [target]:not(a):not(form):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'attribute target not allowed on this element'; | ||
| } |
+108
-110
@@ -15,4 +15,2 @@ /* | ||
| line-height: 0; | ||
| outline: 1px solid #000000; | ||
| margin: 8px; | ||
| } | ||
@@ -27,4 +25,4 @@ /* | ||
| } | ||
| html:not([lang])::before, | ||
| html[lang=""]::before { | ||
| html:not([lang]):not([data-hvi])::before, | ||
| html[lang=""]:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -44,5 +42,5 @@ background-color: var(--c-level1); | ||
| } | ||
| style:empty::before, | ||
| script:not([src]):empty::before, | ||
| title:empty::before { | ||
| style:empty:not([data-hvi])::before, | ||
| script:not([src]):empty:not([data-hvi])::before, | ||
| title:empty:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -57,21 +55,21 @@ background-color: var(--c-level1); | ||
| } | ||
| [style=""], | ||
| [title=""], | ||
| [id=""], | ||
| [src=""], | ||
| [href=""], | ||
| [name=""], | ||
| [for=""], | ||
| [type=""], | ||
| [width=""], | ||
| [height=""] { | ||
| [style=""]:not([data-hvi]), | ||
| [title=""]:not([data-hvi]), | ||
| [id=""]:not([data-hvi]), | ||
| [src=""]:not([data-hvi]), | ||
| [href=""]:not([data-hvi]), | ||
| [name=""]:not([data-hvi]), | ||
| [for=""]:not([data-hvi]), | ||
| [type=""]:not([data-hvi]), | ||
| [width=""]:not([data-hvi]), | ||
| [height=""]:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'Those props should not empty'; | ||
| } | ||
| abbr:not([title]) { | ||
| abbr:not([title]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<abbr> needs [title="…"]'; | ||
| } | ||
| a[target]:not([rel*="noopener"]), | ||
| a[target]:not([rel*="noreferrer"]) { | ||
| a[target]:not([rel*="noopener"]):not([data-hvi]), | ||
| a[target]:not([rel*="noreferrer"]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -81,12 +79,12 @@ content: '[target="…"] also needs [rel="noopener"] or [rel="noopener noreferrer"]'; | ||
| /* figure */ | ||
| :not(figure) > figcaption { | ||
| :not(figure) > figcaption:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<figcaption> must be a child of <figure>"; | ||
| } | ||
| figure > figcaption:not(:first-child):not(:last-child), | ||
| figure > figcaption:not(:first-child):not(:last-child) ~ :last-child:not(figcaption) { | ||
| figure > figcaption:not(:first-child):not(:last-child):not([data-hvi]), | ||
| figure > figcaption:not(:first-child):not(:last-child) ~ :last-child:not(figcaption):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<figcaption> must be first/last child of <figure>"; | ||
| } | ||
| figure > figcaption:not(:first-of-type) { | ||
| figure > figcaption:not(:first-of-type):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -96,13 +94,13 @@ content: "<figure> should only contain one <figcaption>"; | ||
| /* ul/ol */ | ||
| :not(ul):not(ol) > li { | ||
| :not(ul):not(ol) > li:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<li> is missing a parent <ul> or <ol>"; | ||
| } | ||
| ol > :not(li), | ||
| ul > :not(li) { | ||
| ol > :not(li):not([data-hvi]), | ||
| ul > :not(li):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "Immediate child of <ol> or <ul> must be <li>"; | ||
| } | ||
| :not(dl) dd, | ||
| :not(dl) dt { | ||
| :not(dl) dd:not([data-hvi]), | ||
| :not(dl) dt:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -112,3 +110,3 @@ content: "<dd> or <dt> is missing a parent <dl> or <div>"; | ||
| /* dl */ | ||
| dl > :not(dt):not(dd):not(div) { | ||
| dl > :not(dt):not(dd):not(div):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -118,16 +116,16 @@ content: "Immediate child of <dl> must be <dt>, <dd>, or <div>"; | ||
| /* form */ | ||
| fieldset > :not(legend):first-child { | ||
| fieldset > :not(legend):first-child:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "Invalid: first-child of <legend>"; | ||
| } | ||
| :not(fieldset) > legend, | ||
| fieldset > legend:not(:first-child) { | ||
| :not(fieldset) > legend:not([data-hvi]), | ||
| fieldset > legend:not(:first-child):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "<legend> must be: first-child of <fieldset>"; | ||
| } | ||
| input[type="radio"]:not([name]) { | ||
| input[type="radio"]:not([name]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'Radios without name="…"'; | ||
| } | ||
| form button:not([type]) { | ||
| form button:not([type]):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -137,16 +135,16 @@ content: '<button> in <form> need [type="…"]'; | ||
| /* dom */ | ||
| a a { | ||
| a a:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<a/> should not be the kids of <a/>'; | ||
| } | ||
| p div, | ||
| p + div:not(:empty) + p:empty { | ||
| p div:not([data-hvi]), | ||
| p + div:not(:empty) + p:empty:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: '<div> is not allowed within <p>'; | ||
| } | ||
| :not(svg) [href]:not(a):not(link):not(area) { | ||
| :not(svg) [href]:not(a):not(link):not(area):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: 'attribute href not allowed on this element'; | ||
| } | ||
| [target]:not(a):not(form) { | ||
| [target]:not(a):not(form):not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
@@ -168,3 +166,3 @@ content: 'attribute target not allowed on this element'; | ||
| } | ||
| body style::before { | ||
| body style:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -182,3 +180,3 @@ background-color: var(--c-level2); | ||
| } | ||
| body link::before { | ||
| body link:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -207,3 +205,3 @@ background-color: var(--c-level2); | ||
| } | ||
| head > style:not(:first-of-type)::before { | ||
| head > style:not(:first-of-type):not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -241,3 +239,3 @@ background-color: var(--c-level2); | ||
| } | ||
| script[src]:not([async]):not([defer])::before { | ||
| script[src]:not([async]):not([defer]):not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -252,70 +250,70 @@ background-color: var(--c-level2); | ||
| } | ||
| span div, | ||
| strong div, | ||
| small div, | ||
| em div, | ||
| i div, | ||
| label div, | ||
| span h1, | ||
| strong h1, | ||
| small h1, | ||
| em h1, | ||
| i h1, | ||
| label h1, | ||
| span h2, | ||
| strong h2, | ||
| small h2, | ||
| em h2, | ||
| i h2, | ||
| label h2, | ||
| span h3, | ||
| strong h3, | ||
| small h3, | ||
| em h3, | ||
| i h3, | ||
| label h3, | ||
| span h4, | ||
| strong h4, | ||
| small h4, | ||
| em h4, | ||
| i h4, | ||
| label h4, | ||
| span h5, | ||
| strong h5, | ||
| small h5, | ||
| em h5, | ||
| i h5, | ||
| label h5, | ||
| span h6, | ||
| strong h6, | ||
| small h6, | ||
| em h6, | ||
| i h6, | ||
| label h6, | ||
| span p, | ||
| strong p, | ||
| small p, | ||
| em p, | ||
| i p, | ||
| label p, | ||
| span form, | ||
| strong form, | ||
| small form, | ||
| em form, | ||
| i form, | ||
| label form, | ||
| span ul, | ||
| strong ul, | ||
| small ul, | ||
| em ul, | ||
| i ul, | ||
| label ul, | ||
| span ol, | ||
| strong ol, | ||
| small ol, | ||
| em ol, | ||
| i ol, | ||
| label ol { | ||
| span div:not([data-hvi]), | ||
| strong div:not([data-hvi]), | ||
| small div:not([data-hvi]), | ||
| em div:not([data-hvi]), | ||
| i div:not([data-hvi]), | ||
| label div:not([data-hvi]), | ||
| span h1:not([data-hvi]), | ||
| strong h1:not([data-hvi]), | ||
| small h1:not([data-hvi]), | ||
| em h1:not([data-hvi]), | ||
| i h1:not([data-hvi]), | ||
| label h1:not([data-hvi]), | ||
| span h2:not([data-hvi]), | ||
| strong h2:not([data-hvi]), | ||
| small h2:not([data-hvi]), | ||
| em h2:not([data-hvi]), | ||
| i h2:not([data-hvi]), | ||
| label h2:not([data-hvi]), | ||
| span h3:not([data-hvi]), | ||
| strong h3:not([data-hvi]), | ||
| small h3:not([data-hvi]), | ||
| em h3:not([data-hvi]), | ||
| i h3:not([data-hvi]), | ||
| label h3:not([data-hvi]), | ||
| span h4:not([data-hvi]), | ||
| strong h4:not([data-hvi]), | ||
| small h4:not([data-hvi]), | ||
| em h4:not([data-hvi]), | ||
| i h4:not([data-hvi]), | ||
| label h4:not([data-hvi]), | ||
| span h5:not([data-hvi]), | ||
| strong h5:not([data-hvi]), | ||
| small h5:not([data-hvi]), | ||
| em h5:not([data-hvi]), | ||
| i h5:not([data-hvi]), | ||
| label h5:not([data-hvi]), | ||
| span h6:not([data-hvi]), | ||
| strong h6:not([data-hvi]), | ||
| small h6:not([data-hvi]), | ||
| em h6:not([data-hvi]), | ||
| i h6:not([data-hvi]), | ||
| label h6:not([data-hvi]), | ||
| span p:not([data-hvi]), | ||
| strong p:not([data-hvi]), | ||
| small p:not([data-hvi]), | ||
| em p:not([data-hvi]), | ||
| i p:not([data-hvi]), | ||
| label p:not([data-hvi]), | ||
| span form:not([data-hvi]), | ||
| strong form:not([data-hvi]), | ||
| small form:not([data-hvi]), | ||
| em form:not([data-hvi]), | ||
| i form:not([data-hvi]), | ||
| label form:not([data-hvi]), | ||
| span ul:not([data-hvi]), | ||
| strong ul:not([data-hvi]), | ||
| small ul:not([data-hvi]), | ||
| em ul:not([data-hvi]), | ||
| i ul:not([data-hvi]), | ||
| label ul:not([data-hvi]), | ||
| span ol:not([data-hvi]), | ||
| strong ol:not([data-hvi]), | ||
| small ol:not([data-hvi]), | ||
| em ol:not([data-hvi]), | ||
| i ol:not([data-hvi]), | ||
| label ol:not([data-hvi]) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: "Block elements are not suppose be in the inline or inline block elements"; | ||
| } |
+5
-5
@@ -16,4 +16,2 @@ /* | ||
| line-height: 0; | ||
| outline: 1px solid #000000; | ||
| margin: 8px; | ||
| } | ||
@@ -25,3 +23,3 @@ | ||
| &::before { | ||
| &:not([data-hvi])::before { | ||
| margin: 8px; | ||
@@ -45,4 +43,6 @@ background-color: @color; | ||
| #level1(@text) { | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: @text; | ||
| &:not([data-hvi]){ | ||
| outline: 2px dashed var(--c-level1) !important; | ||
| content: @text; | ||
| } | ||
| } | ||
@@ -49,0 +49,0 @@ |
+1
-1
| { | ||
| "name": "@_nu/html-validator", | ||
| "version": "0.0.6", | ||
| "version": "0.0.7", | ||
| "description": "Semantic HTML liner in just pure CSS way.", | ||
@@ -5,0 +5,0 @@ "main": "/css/level2.css", |
+3
-1
@@ -23,2 +23,4 @@ # html-validator | ||
| if you wanna ignore any element just add `data-hvi` attr. | ||
| ## Content | ||
@@ -38,2 +40,2 @@ | ||
| * https://github.com/t7/construct.css | ||
| * [https://github.com/t7/construct.css](https://github.com/t7/construct.css) |
29065
12.28%40
5.26%448
-0.88%