clipboard: move head styles to stylesheet #286

to keep it all in place and maybe later use caching for partials
This commit is contained in:
Sören Weber 2022-06-23 21:39:47 +02:00
parent 8ff2bbe9eb
commit 3b97db45e1
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
3 changed files with 11 additions and 13 deletions

View file

@ -24,7 +24,7 @@
{{- partial "stylesheet.html" . }}
{{- partial "custom-header.html" . }}
</head>
<body class="mobile-support{{ if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }} print{{ end }}" data-url="{{ .RelPermalink }}">
<body class="mobile-support{{ if eq (.Scratch.Get "relearnOutputFormat") "PRINT" }} print{{ end }}{{- if .Site.Params.disableInlineCopyToClipBoard }} disableInlineCopyToClipboard{{ end }}" data-url="{{ .RelPermalink }}">
<div id="body" class="default-animation">
<div id="sidebar-overlay"></div>
<div id="toc-overlay"></div>

View file

@ -12,18 +12,6 @@
<link href="{{"css/ie.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{"css/variant.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{"css/print.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet"{{ if ne (.Scratch.Get "relearnOutputFormat") "PRINT" }} media="print"{{ end }}>
{{- if .Site.Params.disableInlineCopyToClipBoard }}
<style>
:not(pre) > code.copy-to-clipboard-code + span.copy-to-clipboard-button {
display: none;
}
:not(pre) > code.copy-to-clipboard-code {
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
border-right-width: 1px;
}
</style>
{{- end }}
<script src="{{"js/variant.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}"></script>
<script>
{{ "// hack to let hugo tell us how to get to the root when using relativeURLs, it needs to be called *url= for it to do its magic:" | safeJS }}

View file

@ -980,6 +980,16 @@ pre .copy-to-clipboard-button {
top: 4px;
}
.disableInlineCopyToClipboard :not(pre) > code.copy-to-clipboard-code + span.copy-to-clipboard-button {
display: none;
}
.disableInlineCopyToClipboard :not(pre) > code.copy-to-clipboard-code {
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
border-right-width: 1px;
}
#homelinks {
border-bottom-style: solid;
border-bottom-width: 4px;