-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(forms)!: move
:user-valid, :user-invalid
into a new packag…
…e `@form-validation` (#41)
- Loading branch information
1 parent
2031aa7
commit 1ecbb97
Showing
8 changed files
with
43 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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 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 @@ | ||
textarea:user-invalid, | ||
select:user-invalid, | ||
input:not([type="radio"],[type="checkbox"],[type="range"],[type="submit"],[type="image"]):user-invalid { | ||
border: 1px solid var(--danger); | ||
} | ||
|
||
textarea:user-valid, | ||
select:user-valid, | ||
input:not([type="radio"],[type="checkbox"],[type="range"],[type="submit"],[type="image"]):user-valid { | ||
border: 1px solid var(--success); | ||
} |
This file contains 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,17 @@ | ||
<p> | ||
<em>matcha.css</em> provides rules that automatically colors the borders of inputs based on their validation status. | ||
</p> | ||
<ul> | ||
<li><code data-hl="css">:user-valid</code> has <code><span class="success">◉</span> --success</code> borders.</li> | ||
<li><code data-hl="css">:user-invalid</code> has <code><span class="danger">◉</span> --danger</code> borders.</li> | ||
</ul> | ||
<div class="example"> | ||
<p class="note">*No validation except the ones operated by the browser are performed.</p> | ||
<form method="get" onsubmit="event.preventDefault()"> | ||
<label> | ||
URL: | ||
<small>Type an URL below. If it is valid, it'll appear in <code><span class="success">◉</span> --success</code> while it'll appear in <code><span class="danger">◉</span> --danger</code> if not.</small> | ||
<input required type="url" placeholder="https://example.com"> | ||
</label> | ||
</form> | ||
</div> |
This file contains 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 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 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 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