Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better contrast for input fields #417

Merged
merged 3 commits into from
Jan 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions static/css/_forms.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
label {
display: block;
margin: 2em auto 1em;
margin: 2em auto .5em;
font-size: 1.2em;
max-width: 40rem;
}
input, textarea, select {
transition: all 0.1s ease-in;
display: block;
width: 100%;
max-width: 40rem;
margin: auto;
padding: 1em;
box-sizing: border-box;

background: $white;
background: $form-input-background;
color: $black;
border: none;
border: solid $lightgray thin;
border-radius: 0.5em;

font-size: 1.2em;
font-weight: 400;

&:focus {
background: $white;
border-color: $purple;
}
}
Expand Down Expand Up @@ -104,6 +100,7 @@ input[type="submit"] { display: block; }

// Writing page
form.new-post {
max-width: 60em;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will enforce the max-width for all element inside so we don't have to define the max-width for every element that can be used in a form element

.title {
margin: 0 auto;
padding: 0.75em 0;
Expand All @@ -119,7 +116,6 @@ form.new-post {
min-height: 20em;
overflow-y: hidden;
resize: none;
box-sizing: content-box;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the full history of the project so I don't know why you use a different box sizing here ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't remember either 😅

}
input[type="submit"] {
background: $lightgray;
Expand Down
5 changes: 3 additions & 2 deletions static/css/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ small {

/// Main
body > main > *, .h-feed > * {
padding: 0 20%;
margin: 0 20%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to set the max-width on form element, should not break anything

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it broke the article list on the profile page, but that's not a real problem. However if you want to fix it, just replace padding with margin in .cards too.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and actually it is not broken, just different from what we currently have)

}

body > main > .h-entry, .h-feed {
padding: 0;
margin: 0;
}

main {
Expand All @@ -66,6 +66,7 @@ main {
}
h1 {
font-size: 2.5em;
font-weight: 300;
margin-top: 1em;

&.article {
Expand Down
1 change: 1 addition & 0 deletions static/css/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Colors

$background: #F4F4F4;
$form-input-background: #FFFFFF;
$gray: #E3E3E3;
$lightgray: #ECECEC;
$black: #242424;
Expand Down
7 changes: 7 additions & 0 deletions static/css/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
@import url('/static/fonts/Lora/Lora.css');
@import url('/static/fonts/Playfair_Display/PlayfairDisplay.css');

html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}

@import 'variables';
@import 'global';
@import 'header';
Expand Down