Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ theme = ["GDCDocsTheme", "docsy"]

## License

(C) 2007-2023 GoodData Corporation
(C) 2007-2026 GoodData Corporation

For more information, please see [LICENSE](LICENSE).
2 changes: 1 addition & 1 deletion assets/icons/chevron-menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/icon-moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/icons/icon-sun.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion assets/js/base.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation
95 changes: 95 additions & 0 deletions assets/js/theme-switcher.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// (C) 2026 GoodData Corporation
// Theme switcher — light / dark preference with localStorage persistence
// and respect for the OS prefers-color-scheme media query.
//
// This script is split in two parts:
// 1. A tiny inline snippet (injected into <head> via Hugo) that applies the
// stored / OS theme *before* first paint to prevent FOUC.
// 2. The interactive toggle wired to #gd-theme-switcher once the DOM loads.
//
// Only part 2 lives in this file. Part 1 is a separate <script> block in
// layouts/partials/theme-init.html (rendered as an inline script).

(function () {
"use strict";

var STORAGE_KEY = "gd-theme";
var DARK_CLASS = "dark";
var DATA_ATTR = "data-theme";

function getStoredTheme() {
try {
return localStorage.getItem(STORAGE_KEY);
} catch (_) {
return null;
}
}

function storeTheme(theme) {
try {
localStorage.setItem(STORAGE_KEY, theme);
} catch (_) {}
}

function applyTheme(theme) {
var html = document.documentElement;
if (theme === DARK_CLASS) {
html.setAttribute(DATA_ATTR, DARK_CLASS);
} else {
html.removeAttribute(DATA_ATTR);
}
}

function currentTheme() {
return document.documentElement.getAttribute(DATA_ATTR) === DARK_CLASS
? DARK_CLASS
: "light";
}

function wireButton() {
var btn = document.getElementById("gd-theme-switcher");
if (!btn) return;

function updateAriaLabel(theme) {
btn.setAttribute(
"aria-label",
theme === DARK_CLASS
? "Switch to light theme"
: "Switch to dark theme"
);
}

updateAriaLabel(currentTheme());

btn.addEventListener("click", function () {
var next = currentTheme() === DARK_CLASS ? "light" : DARK_CLASS;
applyTheme(next);
storeTheme(next);
updateAriaLabel(next);
});
}

// Wire up button after DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", wireButton);
} else {
wireButton();
}

// Sync with OS preference changes (e.g. the user toggles system dark mode
// while the page is open) — only if they haven't made an explicit choice.
if (window.matchMedia) {
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", function (e) {
if (!getStoredTheme()) {
applyTheme(e.matches ? DARK_CLASS : "light");
var btn = document.getElementById("gd-theme-switcher");
if (btn) {
btn.setAttribute(
"aria-label",
e.matches ? "Switch to light theme" : "Switch to dark theme"
);
}
}
});
}
})();
2 changes: 1 addition & 1 deletion assets/json/offline-search-index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{/* (C) 2023 GoodData Corporation */}}
{{/* (C) 2026 GoodData Corporation */}}
{{- $.Scratch.Add "offline-search-index" slice -}}
{{- $pages := where .Site.AllPages ".Params.exclude_search" "!=" true -}}
{{- if eq hugo.Environment "public" -}}
Expand Down
5 changes: 4 additions & 1 deletion assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation

// Import external styles TODO: link those directly from gooddata/gdc-website repository
@import "functions/functions.pxtorem";
Expand Down Expand Up @@ -31,6 +31,9 @@
@import "404";
@import "skip-links";
@import "heading-anchor";
@import "theme-switcher";
@import "dark-theme";
@import "cta-banner";

#print {
display: none; // Hide print functionality for now
Expand Down
6 changes: 3 additions & 3 deletions assets/scss/addon-widget.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation

.addon-widget {
display: inline-flex;
Expand All @@ -9,10 +9,10 @@
margin-bottom: 15px;
padding: 6px 12px;
border-radius: 3px;
color: $color-deep-purple;
color: $color-black;
font-size: 14px;
line-height: 1;
background: #FFF6CC;
background: lighten($color-yellow, 25%);

svg {
margin-right: 8px;
Expand Down
42 changes: 31 additions & 11 deletions assets/scss/alert.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation

@import "variables/variables";

.alert,
.td-content > blockquote {
padding: 8px 16px 8px 45px;
padding: 24px 32px 24px 68px;
border: none;
border-left: $alert-border-width solid $color-gray-tag;
border-radius: 0;
border-left: $alert-border-width solid $color-storm-gray;
border-radius: 6px;
color: $color-alert;
background-color: $color-alert-bg;

Expand All @@ -21,8 +21,10 @@

&-heading {
.td-content & {
margin-top: 10px;
margin-top: 0;
margin-bottom: 5px;
font-size: 20px;
line-height: 1.3;
}
}

Expand All @@ -34,19 +36,37 @@
&-info {
border-left-color: $color-alert-info;
background-color: $color-alert-info-bg;
color: $color-alert-info;

.alert-heading {
color: $color-alert-info;
}

> svg path {
fill: $color-alert-info;
}
}

&-warning {
border-left-color: $color-alert-warning;
background-color: $color-alert-warning-bg;
color: $color-black;

.alert-heading {
color: $color-black;
}

> svg path {
fill: $color-alert-warning;
}
}

&-label {
padding-top: 8px;
padding-bottom: 8px;
border-left-color: transparent;
color: $color-white;
background-color: $color-deep-purple;
color: $color-alert-label;
background-color: $color-alert-label-bg;

&::before {
content: "";
Expand All @@ -55,7 +75,7 @@
left: -$alert-border-width;
bottom: 0;
width: $alert-border-width;
border-left: $alert-border-width solid rgba($color-deep-purple, 0.3);
border-left: $alert-border-width solid rgba($color-alert-label-bg, 0.3);
background-color: $color-white;
}

Expand All @@ -72,8 +92,8 @@

> svg {
position: absolute;
top: 13px;
left: 15px;
top: 26px;
left: 32px;
}

strong {
Expand All @@ -84,4 +104,4 @@
.td-content .alert.alert-label {
margin-top: 1.5rem;
margin-bottom: 1.5rem;
}
}
2 changes: 1 addition & 1 deletion assets/scss/api-reference.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation
@import "variables/variables";

.api-reference {
Expand Down
11 changes: 9 additions & 2 deletions assets/scss/breadcrumbs.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation
// This file is overridden in Tiger
@import "variables/variables";

.gd-breadcrumb {
display: none;
Expand Down Expand Up @@ -32,7 +33,13 @@
&:hover,
&:focus,
&:active {
color: $color-deep-purple;
color: $color-marlin-black;
}

&:hover,
&:focus,
&:active {
color: $color-black;
}
}
}
Expand Down
47 changes: 27 additions & 20 deletions assets/scss/code-select.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// (C) 2023 GoodData Corporation
// (C) 2026 GoodData Corporation
@import "variables/variables";

.td-content .highlight,
.td-content .code-toolbar {
border: none;
border-radius: 0;
background-color: $color-text;
border-radius: 6px;
background-color: $color-code-bg;

pre {
outline: none;
Expand All @@ -22,7 +22,15 @@

button {
height: 27px;
background-color: #433860;
padding: 6px 8px;
border-radius: 4px;
background-color: $color-marlin-black;
color: $color-silver-gray;
font-size: 14px;
box-shadow: none;
border: none;
line-height: 1.3;
transition: background-color $transition, color $transition;

&.expand-button {
position: relative;
Expand All @@ -49,26 +57,25 @@
}

&:hover {
box-shadow: 0 1px 1px 0 rgba(20, 56, 93, 0.15), inset 0 -1px 0 0 rgba(177, 193, 209, 0.6);
color: #464e56;
background: #f5f8fa;
border-color: rgba(31,52,73,0.2);
background-color: $color-gunpowder-gray;
color: $color-white;
box-shadow: none;
border-color: transparent;
}

&:focus {
box-shadow: 0 0 3px 1px rgba(69, 199, 239, 0), 0 1px 2px 0 rgba(20, 56, 93, 0.15), inset 0 -1px 0 0 rgba(177, 193, 209, 0.6);
border-color: rgba(20, 178, 226, 0.75);
background: #f5f8fa;
outline: 2px solid -webkit-focus-ring-color;
background-color: $color-gunpowder-gray;
color: $color-white;
outline: 2px solid $color-ocean-blue;
outline-offset: 2px;
box-shadow: none;
transition: none;
}

&:active {
box-shadow: inset 0 1px 0 0 rgba(177, 193, 209, 0.65);
color: #464e56;
border-color: #b1c1d1;
background: #ecf0f5;
background-image: linear-gradient(to top, #dee6ef, #ecf0f5);
background-color: $color-storm-gray;
color: $color-white;
box-shadow: none;
}

span {
Expand Down Expand Up @@ -116,15 +123,15 @@
flex-direction: column;
margin-top: 20px;
margin-bottom: 20px;
background-color: $color-text;
background-color: $color-code-bg;

&__tabs {
display: flex;
align-self: flex-end;
margin: 10px;
padding: 1px;
border-radius: 5px;
background-color: #545C61;
background-color: $color-gunpowder-gray;
}

&__tab {
Expand All @@ -141,7 +148,7 @@

&.active {
color: $color-white;
background-color: $color-shocking-pink;
background-color: $color-cta;
}
}

Expand Down
Loading
Loading