Переглянути джерело

Apply site color theme to cookie consent banner (#529)

Pedro J. Ortiz 7 роки тому
батько
коміт
fe8ea7b4e1
1 змінених файлів з 7 додано та 3 видалено
  1. 7 3
      layouts/partials/cookie_consent.html

+ 7 - 3
layouts/partials/cookie_consent.html

@@ -1,4 +1,5 @@
 {{ if .Site.Params.privacy_pack }}
+{{ $scr := .Scratch }}
 <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
 <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
 <script>
@@ -6,12 +7,15 @@
     window.cookieconsent.initialise({
       "palette": {
         "popup": {
-          "background": "#000"
+          "background": "{{ $scr.Get "primary" }}",
+          "text": "{{ $scr.Get "background" }}"
         },
         "button": {
-          "background": "#f1d600"
+          "background": "{{ $scr.Get "background" }}",
+          "text": "{{ $scr.Get "primary" }}"
         }
       },
+      "theme": "classic",
       "content": {
         "message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }},
         "dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }},
@@ -19,4 +23,4 @@
       }
     })});
 </script>
-{{ end }}
+{{ end }}