Skip to content

Instantly share code, notes, and snippets.

@hadyfayed
Created January 28, 2014 04:45
Show Gist options
  • Save hadyfayed/8662388 to your computer and use it in GitHub Desktop.
Save hadyfayed/8662388 to your computer and use it in GitHub Desktop.
A Pen by Arlekino.
h1 Responsive form
.form-row
input type="text" placeholder="Your e-Mail"
input type="password" placeholder="Password"
button Login
@import url(http://fonts.googleapis.com/css?family=Alegreya+Sans+SC:300,400,500|Josefin+Sans:400,600|Alegreya+Sans:400,500|Exo+2:400,500,600);
body {
padding: 0px;
background-color: #fff;
-webkit-font-smoothing: antialiased;
-webkit-backface-visibility: hidden;
}
h1 {
font-size: 48px;
font-family: Helvetica Neue, sans-serif;
font-weight: 300;
text-align: center;
margin-bottom: 60px;
}
.form-row {
display: block;
border: 2px solid #aaa;
-webkit-transform: scale(.5);
-moz-transform: scale(.5);
transform: scale(.5);
}
.form-row > :first-child {
border-left: 0;
}
.form-row > * {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 33.33%;
}
button,input {
display: inline-block;
padding: 40px 50px;
font-size: 28px;
font-family: Helvetica Neue, sans-serif;
-webkit-font-smoothing: antialiased;
color: #444;
background: #fff;
margin: 0;
border: 0;
border-color: #aaa;
border-style: solid;
border-width: 0;
border-left-width: 2px;
outline: none;
}
input {
display: inline-block;
font-weight: 400;
position: relative;
transition: all .25s;
}
input:hover {
-moz-box-shadow: inset 0 0 0 5px rgba(0,0,0,.05);
box-shadow: inset 0 0 0 5px rgba(0,0,0,.05);
}
input:focus {
background-color: #222;
color: #fff;
}
button {
text-transform: uppercase;
letter-spacing: 1px;
font-weight: 600;
-moz-transition: all .5s;
transition: all .5s;
background-color: rgba(255,255,255,0);
}
@-webkit-keyframes buttonpress {
0, 100% {
-webkit-transform: scale(1.1);
}
50% {
-webkit-transform: scale(1);
background-color: #222;
color: #fff;
}
}
@media screen and (max-width: 1200px) {
.form-row > button {
width: 100%;
border-top-width: 2px;
border-left-width: 0;
}
.form-row > input {
width: 50%;
}
}
@media screen and (max-width: 700px) {
.form-row > button {
width: 100%;
border-top-width: 2px;
border-left-width: 0;
}
.form-row > input {
width: 100%;
border-left-width: 0;
border-top-width: 2px;
}
.form-row > :first-child {
border-top-width: 0;
}
}
button:hover {
-webkit-transform: scale(1.1);
background-color: rgba(255,255,255,1);
border-width: 0;
}
button:focus {
-webkit-animation: buttonpress .5s ease;
animation: buttonpress .5s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment