Browse Source

Tweak the poll's labels for mobile with a CSS media query.

Thanks @pierre-louis for the bug report !
mj
domi41 2 years ago
parent
commit
53643f0ebc
  1. 2
      templates/repo/polls/poll_badge.tmpl
  2. 14
      web_src/less/_poll.less

2
templates/repo/polls/poll_badge.tmpl

@ -38,7 +38,7 @@
{{ if $.Super.IsSigned }}
<div class="judgment-forms">
{{ range $grade, $icon := .Poll.GetGradationList }}
<form class="judgment-form {{ if (eq $grade $userGrade) }}selected{{ end }}" action="{{ $.Super.AppSubUrl }}/{{ $.Super.RepoRelPath }}/polls/{{ $pollID }}/judgments" method="post">
<form class="judgment-form{{ if (eq $grade $userGrade) }} selected{{ end }}" action="{{ $.Super.AppSubUrl }}/{{ $.Super.RepoRelPath }}/polls/{{ $pollID }}/judgments" method="post">
{{ $.Super.CsrfTokenHtml }}
<input type="hidden" name="redirect" value="{{ $.Super.AppSubUrl }}/{{ $.Super.RepoRelPath }}/issues/{{ $candidateID }}">
<input type="hidden" name="grade" value="{{ $grade }}">

14
web_src/less/_poll.less

@ -7,6 +7,9 @@
//
@mobile: ~"only screen and (max-width: 600px)";
/* Emote Support */
.emote {
font-family: "Source Code Pro", Consolas, monaco, monospace !important;
@ -44,10 +47,15 @@
.poll-badge {
display: inline-block;
margin-top: 0.3em;
margin-bottom: 0.3em;
/* Otherwise the h1 blocks a portion of the label's hover area */
position: relative;
z-index: 1;
/***************************************************************/
@media @mobile {
display: block;
}
}
.poll-badge:focus-within .judgment-forms,
@ -119,9 +127,9 @@
color: darkred;
position: absolute;
content: "×";
top: 0.11em;
left: 0.19em;
font-size: 2em;
top: 0.05em;
left: 0.05em;
font-size: 3em;
opacity: 0.8;
pointer-events: none;
}

Loading…
Cancel
Save