about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2023-02-20 11:32:27 +0100
committerGitHub <noreply@github.com>2023-02-20 11:32:27 +0100
commitd3b4d4d4f3ccee19f272c66e7c9acd803661e65b (patch)
treeca078179bb6e196b1df325f0f1faa6b624a86fc5
parentb65ca7acc9753227a5f3958c894d3ece9024dcd2 (diff)
Change compose form checkbox to native input with `appearance: none` (#22949)
-rw-r--r--app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx2
-rw-r--r--app/javascript/styles/mastodon/components.scss8
2 files changed, 3 insertions, 7 deletions
diff --git a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx
index 1bcce5731..03f831d28 100644
--- a/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx
+++ b/app/javascript/mastodon/features/compose/containers/sensitive_button_container.jsx
@@ -54,8 +54,6 @@ class SensitiveButton extends React.PureComponent {
             disabled={disabled}
           />
 
-          <span className={classNames('checkbox', { active })} />
-
           <FormattedMessage
             id='compose_form.sensitive.hide'
             defaultMessage='{count, plural, one {Mark media as sensitive} other {Mark media as sensitive}}'
diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss
index 62e48eb3d..49a5bda34 100644
--- a/app/javascript/styles/mastodon/components.scss
+++ b/app/javascript/styles/mastodon/components.scss
@@ -405,10 +405,7 @@ body > [data-popper-placement] {
     }
 
     input[type='checkbox'] {
-      display: none;
-    }
-
-    .checkbox {
+      appearance: none;
       display: inline-block;
       position: relative;
       border: 1px solid $ui-primary-color;
@@ -420,8 +417,9 @@ body > [data-popper-placement] {
       top: -1px;
       border-radius: 4px;
       vertical-align: middle;
+      cursor: inherit;
 
-      &.active {
+      &:checked {
         border-color: $highlight-text-color;
         background: $highlight-text-color
           url("data:image/svg+xml;utf8,<svg width='18' height='18' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M4.5 8.5L8 12l6-6' stroke='white' stroke-width='1.5'/></svg>")