forked from alphagov/govuk_elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request alphagov#47 from alphagov/remove-native-date-picker
Improve date pattern
- Loading branch information
Showing
8 changed files
with
91 additions
and
131 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,46 +1,39 @@ | ||
// Date of birth | ||
// Date pattern | ||
|
||
.form-date label { | ||
display: block; | ||
margin-bottom: 5px; | ||
// Hide the 'spinner' for webkit | ||
// and also for Firefox | ||
input::-webkit-outer-spin-button, | ||
input::-webkit-inner-spin-button { | ||
-webkit-appearance: none; | ||
margin: 0 | ||
} | ||
|
||
.form-date .form-group { | ||
width: 50px; | ||
float: left; | ||
margin-right: 20px; | ||
margin-bottom: 0; | ||
clear: none; | ||
input[type=number] { | ||
-moz-appearance: textfield | ||
} | ||
|
||
.form-date .form-group-year { | ||
width: 70px; | ||
} | ||
.form-date { | ||
|
||
.form-date .form-group input { | ||
width: 100%; | ||
} | ||
.form-group { | ||
float: left; | ||
width: 50px; | ||
|
||
margin-right: 20px; | ||
margin-bottom: 0; | ||
clear: none; | ||
|
||
// Use Modernizr to detect for touch events | ||
// Build: http://modernizr.com/download/#-touch-cssclasses-teststyles-prefixes | ||
label { | ||
display: block; | ||
margin-bottom: 5px; | ||
} | ||
|
||
// Hide date of birth | ||
.touch .form-date { | ||
display: none; | ||
} | ||
input { | ||
width: 100%; | ||
} | ||
|
||
// Hide native date of birth | ||
.no-touch .native-date-picker { | ||
display: none; | ||
} | ||
} | ||
|
||
// Show native date of birth | ||
.touch .native-date-picker { | ||
display: block; | ||
} | ||
.form-group-year { | ||
width: 70px; | ||
} | ||
|
||
// Set a minimum height for date inputs | ||
.touch input[type="date"] { | ||
min-height: 36px; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
{{<govuk_template}} | ||
|
||
{{$cookieMessage}} | ||
{{>cookie_message}} | ||
{{/cookieMessage}} | ||
|
||
{{$head}} | ||
{{>head}} | ||
{{/head}} | ||
|
||
{{$propositionHeader}} | ||
{{>propositional_navigation}} | ||
{{/propositionHeader}} | ||
|
||
{{$headerClass}}with-proposition{{/headerClass}} | ||
|
||
{{$content}} | ||
<main id="content" role="main"> | ||
|
||
<a href="/" class="example-back-link">Back to GOV.UK elements</a> | ||
|
||
<h1 class="heading-xlarge">Date test page</h1> | ||
|
||
<!-- Date of birth --> | ||
{{> form_date }} | ||
|
||
</main><!-- /#content --> | ||
{{/content}} | ||
|
||
{{$bodyEnd}} | ||
{{>scripts}} | ||
{{/bodyEnd}} | ||
|
||
{{/govuk_template}} |
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
<div class="form-group"> | ||
<fieldset> | ||
<legend class="form-label-bold">Date of birth</legend> | ||
|
||
<div class="form-date"> | ||
|
||
<p class="form-hint">For example, 31 3 1980</p> | ||
|
||
<div class="form-group form-group-day"> | ||
<label for="dob-day">Day</label> | ||
<input class="form-control" id="dob-day" type="number" pattern="[0-9]*" min="0" max="31"> | ||
</div> | ||
|
||
<div class="form-group form-group-month"> | ||
<label for="dob-month">Month</label> | ||
<input class="form-control" id="dob-month" type="number" pattern="[0-9]*" min="0" max="12"> | ||
</div> | ||
|
||
<div class="form-group form-group-year"> | ||
<label for="dob-year">Year</label> | ||
<input class="form-control" id="dob-year" type="number" pattern="[0-9]*" min="0" max="2014"> | ||
</div> | ||
</div> | ||
|
||
</fieldset> | ||
</div> |