Unverified Commit 67cf8a10 authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #1605 from hypothesis/tag-editor-touch-input

Use mobile-friendly font size for all input fields
parents e481878a 27ee5e90
...@@ -283,7 +283,7 @@ function MarkdownEditor({ onEditText = () => {}, text = '' }) { ...@@ -283,7 +283,7 @@ function MarkdownEditor({ onEditText = () => {}, text = '' }) {
/> />
) : ( ) : (
<textarea <textarea
className="markdown-editor__input form-input form-textarea" className="markdown-editor__input"
ref={input} ref={input}
onClick={e => e.stopPropagation()} onClick={e => e.stopPropagation()}
onKeydown={handleKeyDown} onKeydown={handleKeyDown}
......
...@@ -5,15 +5,4 @@ ...@@ -5,15 +5,4 @@
@include forms.form-input; @include forms.form-input;
width: 100%; width: 100%;
display: block; display: block;
&:focus,
&.js-focus {
@include forms.form-input-focus;
}
}
.form-textarea {
min-height: 8em;
max-width: 100%;
resize: vertical;
} }
...@@ -28,6 +28,16 @@ ...@@ -28,6 +28,16 @@
0px 0px 5px var.$color-focus-shadow; 0px 0px 5px var.$color-focus-shadow;
} }
@mixin form-input-focus {
outline: none;
background-color: var.$white;
@include focus-outline;
@include placeholder {
color: var.$grey-5;
}
}
@mixin form-input { @mixin form-input {
@include var.font-normal; @include var.font-normal;
border: 1px solid var.$grey-3; border: 1px solid var.$grey-3;
...@@ -36,15 +46,13 @@ ...@@ -36,15 +46,13 @@
font-weight: normal; font-weight: normal;
color: var.$grey-5; color: var.$grey-5;
background-color: var.$grey-0; background-color: var.$grey-0;
}
@mixin form-input-focus { &:focus {
outline: none; @include form-input-focus;
background-color: var.$white; }
@include focus-outline; @media (pointer: coarse) {
@include placeholder { font-size: var.$touch-input-font-size;
color: var.$grey-5;
} }
} }
......
@use "../../mixins/forms";
@use "../../variables" as var; @use "../../variables" as var;
$toolbar-border: 0.1em solid var.$grey-3; $toolbar-border: 0.1em solid var.$grey-3;
...@@ -62,11 +63,15 @@ $toolbar-border: 0.1em solid var.$grey-3; ...@@ -62,11 +63,15 @@ $toolbar-border: 0.1em solid var.$grey-3;
margin-bottom: 2px; // Tweak to align help icon better with adjacent buttons margin-bottom: 2px; // Tweak to align help icon better with adjacent buttons
} }
@media (pointer: coarse) { .markdown-editor__input {
.markdown-editor__input { @include forms.form-input;
font-size: var.$touch-input-font-size;
} min-height: 8em;
resize: vertical;
width: 100%;
}
@media (pointer: coarse) {
.markdown-editor__toolbar { .markdown-editor__toolbar {
// Remove the padding to avoid the toolbar taking up too much space as we // Remove the padding to avoid the toolbar taking up too much space as we
// make the buttons larger. // make the buttons larger.
......
@use "../../mixins/focus"; @use "../../mixins/forms";
@use "../../variables" as var; @use "../../variables" as var;
.search-input__form { .search-input__form {
...@@ -14,17 +14,16 @@ ...@@ -14,17 +14,16 @@
} }
.search-input__input { .search-input__input {
@include focus.outline-on-keyboard-focus; @include forms.form-input;
flex-grow: 1; flex-grow: 1;
order: 1; order: 1;
color: var.$text-color;
// Disable default browser styling for the input. // Disable default browser styling for the input.
border: none; &:not(:focus) {
padding: 0px; border: none;
width: 100%; padding: 0px;
}
// The search box expands when focused, via a change in the // The search box expands when focused, via a change in the
// `max-width` property. // `max-width` property.
...@@ -45,9 +44,3 @@ ...@@ -45,9 +44,3 @@
padding-left: 6px; padding-left: 6px;
} }
} }
@media (pointer: coarse) {
.search-input__input {
font-size: var.$touch-input-font-size;
}
}
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
&__input { &__input {
@include forms.form-input; @include forms.form-input;
width: 100%; width: 100%;
&:focus {
@include forms.form-input-focus;
}
} }
&__tag-list { &__tag-list {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment