use class="hidden" instead of creating new classes

Use class "hidden" instead of styled classes to ensure that input elments stay
hidden when the Content-Security-Policy header has "style-src 'self';"
This commit is contained in:
Paul Twohey 2019-08-31 18:38:16 -07:00 committed by Alex Shpak
parent 438f011ff5
commit 964968be39
6 changed files with 4 additions and 17 deletions

View file

@ -31,10 +31,6 @@
padding: $padding-16; padding: $padding-16;
} }
.book-expand-expander {
display: none;
}
input[type="checkbox"]:checked + .book-expand-content { input[type="checkbox"]:checked + .book-expand-content {
display: block; display: block;
} }
@ -60,10 +56,6 @@
cursor: pointer; cursor: pointer;
} }
.book-tabs-radio {
display: none;
}
.book-tabs-content { .book-tabs-content {
order: 999; //Move content blocks to the end order: 999; //Move content blocks to the end
width: 100%; width: 100%;

View file

@ -54,11 +54,6 @@ img {
vertical-align: baseline; vertical-align: baseline;
} }
// hide menu checkbox with CSS
#menu-control {
display: none;
}
aside nav ul { aside nav ul {
padding: 0; padding: 0;
margin: 0; margin: 0;

View file

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<input type="checkbox" id="menu-control" /> <input type="checkbox" class="hidden" id="menu-control" />
<main class="flex container"> <main class="flex container">
<aside class="book-menu fixed"> <aside class="book-menu fixed">

View file

@ -7,7 +7,7 @@
</head> </head>
<body> <body>
<input type="checkbox" id="menu-control" /> <input type="checkbox" class="hidden" id="menu-control" />
<main class="flex container"> <main class="flex container">
<aside class="book-menu fixed"> <aside class="book-menu fixed">
{{ partial "docs/menu" . }} {{ partial "docs/menu" . }}

View file

@ -4,7 +4,7 @@
<span>{{ default "Expand" (.Get 0) }}</span> <span>{{ default "Expand" (.Get 0) }}</span>
<span>{{ default "↕" (.Get 1) }}</span> <span>{{ default "↕" (.Get 1) }}</span>
</div> </div>
<input type="checkbox" class="book-expand-expander" /> <input type="checkbox" class="hidden" />
<div class="book-expand-content markdown-inner"> <div class="book-expand-content markdown-inner">
{{ .Inner | markdownify }} {{ .Inner | markdownify }}
</div> </div>

View file

@ -4,7 +4,7 @@
<div class="book-tabs"> <div class="book-tabs">
{{ range $index, $tab := .Scratch.Get $group }} {{ range $index, $tab := .Scratch.Get $group }}
<input type="radio" class="book-tabs-radio" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} /> <input type="radio" class="hidden" name="{{ $group }}" id="{{ printf "%s-%d" $group $index }}" {{ if not $index }}checked="checked"{{ end }} />
<label for="{{ printf "%s-%d" $group $index }}"> <label for="{{ printf "%s-%d" $group $index }}">
{{ $tab.Name }} {{ $tab.Name }}
</label> </label>