Re #150 - stop using 'size' across all elements and rely on CSS for a better mobile experience (stops fields from pushing out)

pull/158/head
dgtlmoon 3 years ago
parent 2a66ac1db0
commit 0f5d5e6caf

@ -297,8 +297,6 @@ footer {
color: #dd0000; } color: #dd0000; }
.pure-form label { .pure-form label {
font-weight: bold; } font-weight: bold; }
.pure-form input {
width: 100%; }
.pure-form textarea { .pure-form textarea {
width: 100%; } width: 100%; }
@ -307,7 +305,7 @@ footer {
max-width: 95%; } max-width: 95%; }
.edit-form { .edit-form {
padding: 0.5em; padding: 0.5em;
margin: 0.5em; } margin: 0; }
#nav-menu { #nav-menu {
overflow-x: scroll; } } overflow-x: scroll; } }
@ -354,3 +352,12 @@ and also iPads specifically.
background-color: #eee; } background-color: #eee; }
.watch-table.pure-table-striped tr:nth-child(2n-1) td { .watch-table.pure-table-striped tr:nth-child(2n-1) td {
background-color: inherit; } } background-color: inherit; } }
/** Desktop vs mobile input field strategy
- We dont use 'size' with <input> because `size` is too unreliable to override, and will often push-out
- Rely always on width in CSS
*/
@media only screen and (min-width: 761px) {
/* m-d is medium-desktop */
.m-d {
min-width: 80%; } }

@ -401,10 +401,6 @@ footer {
font-weight: bold; font-weight: bold;
} }
input {
width: 100%;
}
textarea { textarea {
width: 100%; width: 100%;
} }
@ -416,7 +412,7 @@ footer {
} }
.edit-form { .edit-form {
padding: 0.5em; padding: 0.5em;
margin: 0.5em; margin: 0;
} }
#nav-menu { #nav-menu {
overflow-x: scroll; overflow-x: scroll;
@ -429,8 +425,7 @@ Max width before this PARTICULAR table gets nasty
This query will take effect for any screen smaller than 760px This query will take effect for any screen smaller than 760px
and also iPads specifically. and also iPads specifically.
*/ */
@media only screen and (max-width: 760px), @media only screen and (max-width: 760px), (min-device-width: 768px) and (max-device-width: 1024px) {
(min-device-width: 768px) and (max-device-width: 1024px) {
.watch-table { .watch-table {
/* Force table to not be like tables anymore */ /* Force table to not be like tables anymore */
@ -496,3 +491,15 @@ and also iPads specifically.
} }
} }
/** Desktop vs mobile input field strategy
- We dont use 'size' with <input> because `size` is too unreliable to override, and will often push-out
- Rely always on width in CSS
*/
@media only screen and (min-width: 761px) {
/* m-d is medium-desktop */
.m-d {
min-width: 80%;
}
}

@ -5,16 +5,16 @@
<form class="pure-form pure-form-stacked" action="{{ url_for('edit_page', uuid=uuid, next = request.args.get('next') ) }}" method="POST"> <form class="pure-form pure-form-stacked" action="{{ url_for('edit_page', uuid=uuid, next = request.args.get('next') ) }}" method="POST">
<fieldset> <fieldset>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.url, placeholder="https://...", size=30, required=true) }} {{ render_field(form.url, placeholder="https://...", required=true, class="m-d") }}
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.title, size=30) }} {{ render_field(form.title, class="m-d") }}
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.tag, size=10) }} {{ render_field(form.tag) }}
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.minutes_between_check, size=5) }} {{ render_field(form.minutes_between_check) }}
{% if using_default_minutes %} {% if using_default_minutes %}
<span class="pure-form-message-inline">Currently using the <a href="{{ url_for('settings_page', uuid=uuid) }}">default global settings</a>, change to another value if you want to be specific.</span> <span class="pure-form-message-inline">Currently using the <a href="{{ url_for('settings_page', uuid=uuid) }}">default global settings</a>, change to another value if you want to be specific.</span>
{% else %} {% else %}
@ -22,7 +22,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.css_filter, size=25, placeholder=".class-name or #some-id, or other CSS selector rule.") }} {{ render_field(form.css_filter, placeholder=".class-name or #some-id, or other CSS selector rule.", class="m-d") }}
<span class="pure-form-message-inline"> <span class="pure-form-message-inline">
<ul> <ul>
<li>CSS - Limit text to this CSS rule, only text matching this CSS rule is included.</li> <li>CSS - Limit text to this CSS rule, only text matching this CSS rule is included.</li>

@ -7,14 +7,14 @@
<form class="pure-form pure-form-stacked settings" action="{{url_for('settings_page')}}" method="POST"> <form class="pure-form pure-form-stacked settings" action="{{url_for('settings_page')}}" method="POST">
<fieldset> <fieldset>
<div class="pure-control-group"> <div class="pure-control-group">
{{ render_field(form.minutes_between_check, size=5) }} {{ render_field(form.minutes_between_check) }}
<span class="pure-form-message-inline">Default time for all watches, when the watch does not have a specific time setting.</span> <span class="pure-form-message-inline">Default time for all watches, when the watch does not have a specific time setting.</span>
</div> </div>
<div class="pure-control-group"> <div class="pure-control-group">
{% if current_user.is_authenticated %} {% if current_user.is_authenticated %}
<a href="{{url_for('settings_page', removepassword='yes')}}" class="pure-button pure-button-primary">Remove password</a> <a href="{{url_for('settings_page', removepassword='yes')}}" class="pure-button pure-button-primary">Remove password</a>
{% else %} {% else %}
{{ render_field(form.password, size=10) }} {{ render_field(form.password) }}
<span class="pure-form-message-inline">Password protection for your changedetection.io application.</span> <span class="pure-form-message-inline">Password protection for your changedetection.io application.</span>
{% endif %} {% endif %}
</div> </div>

@ -7,8 +7,8 @@
<form class="pure-form" action="{{ url_for('api_watch_add') }}" method="POST" id="new-watch-form"> <form class="pure-form" action="{{ url_for('api_watch_add') }}" method="POST" id="new-watch-form">
<fieldset> <fieldset>
<legend>Add a new change detection watch</legend> <legend>Add a new change detection watch</legend>
{{ render_simple_field(form.url, placeholder="https://...", size=30, required=true) }} {{ render_simple_field(form.url, placeholder="https://...", required=true) }}
{{ render_simple_field(form.tag, size=10, value=active_tag if active_tag else '', placeholder="tag") }} {{ render_simple_field(form.tag, value=active_tag if active_tag else '', placeholder="tag") }}
<button type="submit" class="pure-button pure-button-primary">Watch</button> <button type="submit" class="pure-button pure-button-primary">Watch</button>
</fieldset> </fieldset>
<!-- add extra stuff, like do a http POST and send headers --> <!-- add extra stuff, like do a http POST and send headers -->

Loading…
Cancel
Save