Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Theme selector #10181

Merged
merged 31 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6ab333a
rebase
deborahniesz Aug 7, 2024
05a57de
rebase
JessSaavedra Aug 7, 2024
9e58356
Github component, navbar, search bar
deborahniesz Aug 8, 2024
5395ad0
Edit searchbar, breadcrumb separator and markdown h3 title
deborahniesz Aug 8, 2024
d95b772
Tabs, searchbar and WIP in api_docs in dark mode
deborahniesz Aug 13, 2024
0b97ea8
Tabs, searchbar and WIP in api_docs in dark mode
deborahniesz Aug 13, 2024
07e0af5
Improve alerts styling in API docs
JessSaavedra Aug 13, 2024
9cf9004
tweaks for mobile viewport
deborahniesz Aug 15, 2024
0be31e2
fix api docs bug
deborahniesz Aug 15, 2024
452528c
creating css global variables for dark theme
deborahniesz Aug 16, 2024
0c20e42
finished css global variables for dark theme
deborahniesz Aug 19, 2024
0426583
white background images, changed navbar, WIP alerts in GXAPI
deborahniesz Aug 19, 2024
949fadf
change priority for transparent icon in cards
deborahniesz Aug 19, 2024
a519d59
change priority for transparent icon in cards
deborahniesz Aug 19, 2024
f3378f5
change priority for transparent icon in cards
deborahniesz Aug 19, 2024
3f47c7e
transparent background color for dark theme
deborahniesz Aug 19, 2024
f0f563d
transparent background color for dark theme
deborahniesz Aug 19, 2024
874784b
transparent background color for dark theme
deborahniesz Aug 19, 2024
4152a3c
finishing alerts for dark mode
deborahniesz Aug 20, 2024
3b506dc
fix bug close img in dark mode
deborahniesz Aug 20, 2024
42564e2
fix bug close img in dark mode and github component
deborahniesz Aug 20, 2024
95d9612
fix bug in github component
deborahniesz Aug 20, 2024
80b6668
fix bug in github component
deborahniesz Aug 21, 2024
37303c7
fix bug in github component
deborahniesz Aug 21, 2024
16df0e7
fix table in API docs
deborahniesz Aug 21, 2024
3a358eb
fix Expectations Gallery to the right
deborahniesz Aug 21, 2024
04d6733
Removed opacity in navbar and added comment for the navbar items disp…
deborahniesz Aug 21, 2024
80a9136
Fixed tests error
deborahniesz Aug 21, 2024
299eac8
Tweak api docs console boxes in dark mode
JessSaavedra Aug 26, 2024
3463eb3
Fixes after code review
deborahniesz Aug 28, 2024
6841648
Fixes after code review
deborahniesz Sep 2, 2024
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
1 change: 1 addition & 0 deletions docs/docusaurus/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
__MACOSX
oss_docs_versions.zip
docs/reference/api
/coverage/
6 changes: 6 additions & 0 deletions docs/docusaurus/__mocks__/@theme/ThemedImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from 'react';
export default function ThemedImage(props) {
return (
<div></div>
)
}
8 changes: 7 additions & 1 deletion docs/docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = {
]
},
colorMode: {
disableSwitch: true,
disableSwitch: false,
},
zoomSelector: '.markdown :not(em) > img',
// announcementBar: {
Expand All @@ -107,6 +107,7 @@ module.exports = {
logo: {
alt: 'Great Expectations',
src: 'img/GXDocs.svg',
srcDark: 'img/GXDocs-dark.svg',
href: 'https://greatexpectations.io',
},
items: [
Expand All @@ -127,6 +128,11 @@ module.exports = {
position: 'left',
className: 'custom-search-bar',
},
{
type: 'custom-colorModeToggle',
position: 'left',
className: 'color-mode-toggle',
},
{
type: 'custom-githubNavbarItem',
position: 'left',
Expand Down
1 change: 1 addition & 0 deletions docs/docusaurus/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
"\\.(s?)css$": "identity-obj-proxy",
"@docusaurus/(BrowserOnly|ComponentCreator|constants|ExecutionEnvironment|Head|Interpolate|isInternalUrl|Link|Noop|renderRoutes|router|Translate|use.*)":
"identity-obj-proxy",
"@theme/ThemedImage": "<rootDir>/__mock__/@theme/ThemedImage.js",
"@theme/(.*)": "@docusaurus/theme-classic/src/theme/$1",
"@theme-original/(.*)": "identity-obj-proxy",
"@site/(.*)": "website/$1",
Expand Down
8 changes: 4 additions & 4 deletions docs/docusaurus/src/components/GXCard/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
flex-wrap: wrap;
}

html[data-theme="dark"] .gxCard {
background-color: var(--orange-700);
}

.button {
display: inline-block;
position: relative;
Expand Down Expand Up @@ -54,6 +50,10 @@
border-color: var(--blue-600);
background: none;
}

html[data-theme="dark"] .gxCard {
background-color: var(--dark-orange-dark-theme);
}

html[data-theme="dark"] .button__outline {
border-color: var(--blue-300);
Expand Down
15 changes: 13 additions & 2 deletions docs/docusaurus/src/components/LinkCard/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
}

html[data-theme="dark"] .linkCard[href]:hover {
background-color: var(--orange-900);
background-color: var(--dark-orange-dark-theme);
}

.linkCard__icon {
Expand Down Expand Up @@ -54,4 +54,15 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
}

[data-theme='dark'] .linkCard {
background-color: var(--card-background-dark-theme);
border-color: #4E4E4E;
box-shadow: var(--default-box-shadow);
}

[data-theme='dark'] :global(.markdown) .linkCard img {
background-color: transparent;
margin: 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import ColorModeToggle from '@theme-original/Navbar/ColorModeToggle';
import styles from './styles.module.scss';

export default function CustomColorModeToggle(props) {
return (
<div className={styles.colorModeToggle}>
<ColorModeToggle {...props} />
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@import '../../../css/sass_variables';

.colorModeToggle {
padding: var(--ifm-navbar-item-padding-vertical) 0.5rem var(--ifm-navbar-item-padding-vertical) 0.25rem;
}

@media (max-width: $mobile-breakpoint) {
.colorModeToggle {
position: absolute;
right: calc(var(--ifm-navbar-padding-horizontal) + 4.5rem);
padding-right: 0;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, {useEffect, useState} from 'react';
import styles from './styles.module.scss';
import useBaseUrl from "@docusaurus/useBaseUrl";
import ThemedImage from '@theme/ThemedImage';

export default function GithubNavbarItem({ owner, repository, className }) {

Expand All @@ -9,6 +10,7 @@ export default function GithubNavbarItem({ owner, repository, className }) {
const [showGithubBadgeInfo, setShowGithubBadgeInfo] = useState(true);

useEffect(() => {

fetch(`https://api.github.com/repos/${owner}/${repository}`)
.then(response => response.json())
.then(data => {
Expand All @@ -29,22 +31,26 @@ export default function GithubNavbarItem({ owner, repository, className }) {
const githubLogoImg = useBaseUrl(`img/github.svg`);
const starIcon = useBaseUrl(`img/star.svg`);
const forkIcon = useBaseUrl(`img/code-branch.svg`);
const githubMarkDarkImg = useBaseUrl(`img/github-mark-dark.svg`);
const githubLogoDarkImg = useBaseUrl(`img/github-dark.svg`);
const starDarkIcon = useBaseUrl(`img/star-dark.svg`);
const forkDarkIcon = useBaseUrl(`img/code-branch-dark.svg`);

return repository && (
<a href={`https://github.com/${owner}/${repository}`} target="_blank"
className={ className + ' ' + styles.githubBadge + ' ' + (showGithubBadgeInfo ? styles.githubBadgeNoErrors : '')}>
<img src={githubMarkImg} className={styles.githubMark}
<ThemedImage sources={{ dark: githubMarkDarkImg, light: githubMarkImg}} className={styles.githubMark}
alt="Github Invertocat Logo"/>
{ showGithubBadgeInfo && (<div className={styles.githubBadgeInfo}>
<img src={githubLogoImg} className={styles.githubLogo}
<ThemedImage sources={{ dark: githubLogoDarkImg, light: githubLogoImg}} className={styles.githubLogo}
alt="Github Logo"/>
<div className={styles.githubStats}>
<span>
<img src={starIcon} alt="Github Stargazers Count"/>
<ThemedImage sources={{ dark: starDarkIcon, light: starIcon}} alt="Github Stargazers Count"/>
{starsCount}
</span>
<span>
<img src={forkIcon} alt="Github Forks Count"/>
<ThemedImage sources={{ dark: forkDarkIcon, light: forkIcon}} alt="Github Forks Count"/>
{forksCount}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
gap: 0.25rem;
align-items: flex-start;
font-size: var(--p-tiny-font-size);
padding-right: 2rem;
padding: var(--ifm-navbar-item-padding-vertical) 2rem var(--ifm-navbar-item-padding-vertical) 0.25rem;
}

.githubBadgeNoErrors {
Expand Down Expand Up @@ -62,3 +62,4 @@ a:hover {
display: none;
}
}

44 changes: 43 additions & 1 deletion docs/docusaurus/src/components/WasThisHelpful/styles.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
.modalHeaderCloseButton {
align-self: flex-end;
cursor: pointer;
height: 8px;
height: 12px;
margin: auto;
}

Expand Down Expand Up @@ -216,3 +216,45 @@
max-height: unset;
}
}

[data-theme='dark'] {
.feedbackCard {
background-color: var(--payne-gray-color);
border-color: var(--payne-gray-color);
box-shadow: var(--default-box-shadow);
}

.feedbackCardTitle {
color: var(--ifm-font-color-base);
}

.feedbackButton:enabled:hover {
background-color: var(--dark-orange-dark-theme);
}

.feedbackDivider {
border-color: var(--light-gray-dark-theme);
}

.modal {
background-color: #222222;
}

.modalTextInput {
border-color: #F4F4F7;
}

.modalTextLabel {
color: var(--ifm-font-color-base);
}

.modal .modalHeader img {
background-color: transparent;
margin: auto;
}

.submitButton:disabled {
color: var(--light-gray-dark-theme);
background-color: var(--concrete-gray-color);
}
}
10 changes: 9 additions & 1 deletion docs/docusaurus/src/css/alerts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
--ifm-color-success-dark: #B6C647;

--ifm-color-warning-contrast-background: #FEFBF3;
--ifm-color-warning-dark: #F5CE4A;
--ifm-color-warning-dark: #F3C62D;

--ifm-color-danger-contrast-background: #FEF6F9;
--ifm-color-danger-dark: #E54F54;
Expand All @@ -18,6 +18,14 @@
--color-cta-secondary-dark: var(--ifm-color-primary);
}

:root[data-theme='dark'] {
--ifm-color-info-contrast-background: var(--card-background-dark-theme);
--ifm-color-success-contrast-background: var(--card-background-dark-theme);
--ifm-color-warning-contrast-background: var(--card-background-dark-theme);
--ifm-color-danger-contrast-background: var(--card-background-dark-theme);
--ifm-color-cta-contrast-background: var(--card-background-dark-theme);
}

.alert {
border-width: 1px;
border-left-width: var(--ifm-alert-border-left-width);
Expand Down
25 changes: 22 additions & 3 deletions docs/docusaurus/src/css/api_docs/api_docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,26 @@
background-color: #1e1e1e;
}

[data-theme='dark'] & {
p {
color: var(--ifm-font-color-base);
}

cite {
background-color: var(--gray-800);
border: none;
color: var(--ifm-font-color-base);
}

pre {
border: none;
}

.highlight pre {
background-color: var(--payne-gray-color);
border-color: transparent;
box-shadow: 0 3px 6px #00000029;
color: var(--ifm-font-color-base);
}
}
}



Loading
Loading