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

Use css to style icons #516

Merged
merged 2 commits into from
Mar 21, 2024
Merged
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
10 changes: 0 additions & 10 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ const sidebars = {
label: 'Product Documentation',
href: 'https://documentation.sailpoint.com',
},
{
type: 'link',
label: 'Certifications',
href: 'https://university.sailpoint.com/Saba/Web_spf/NA10P1PRD075/guest/categorydetail/categ000000000003041/true/xxemptyxx/',
},
],
},
],
Expand Down Expand Up @@ -252,11 +247,6 @@ const sidebars = {
label: 'Product Documentation',
href: 'https://documentation.sailpoint.com/#identityiq',
},
{
type: 'link',
label: 'Certifications',
href: 'https://university.sailpoint.com/Saba/Web_spf/NA10P1PRD075/guest/categorydetail/categ000000000003042/true/xxemptyxx/',
},
],
},
],
Expand Down
12 changes: 3 additions & 9 deletions src/theme/DocCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import isInternalUrl from '@docusaurus/isInternalUrl';
import {translate} from '@docusaurus/Translate';
import styles from './styles.module.css';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faFolderOpen, faLink, faBook, faArrowUpRightFromSquare } from '@fortawesome/pro-duotone-svg-icons'
import { useColorMode } from '@docusaurus/theme-common';
import { faFolderOpen, faBook, faArrowUpRightFromSquare } from '@fortawesome/pro-duotone-svg-icons'

function CardContainer({href, children}) {
return (
Expand Down Expand Up @@ -39,18 +38,14 @@ function CardLayout({href, icon, title, description}) {
}
function CardCategory({item}) {
const href = findFirstCategoryLink(item);
const {colorMode} = useColorMode();
//const icon = colorMode === 'dark' ? <FontAwesomeIcon icon={faFolderOpen} style={{marginRight: "0.5em"}} color='#0033a1' /> : <FontAwesomeIcon icon={faFolderOpen} style={{marginRight: "0.5em"}} color='#7ecfee' />;
//const icon = <FontAwesomeIcon icon={faFolderOpen} style={{marginRight: "0.5em"}} color='#0033a1' />;
//console.log(item)
// Unexpected: categories that don't have a link have been filtered upfront
if (!href) {
return null;
}
return (
<CardLayout
href={href}
icon={<FontAwesomeIcon icon={faFolderOpen} style={{marginRight: "0.5em"}} color={colorMode === 'dark' ? '#7ecfee' : '#0033a1'} />}
icon={<FontAwesomeIcon icon={faFolderOpen} className={styles.docCardIcon} />}
//icon={icon}
title={item.label}
description={
Expand All @@ -69,8 +64,7 @@ function CardCategory({item}) {
);
}
function CardLink({item}) {
const {colorMode} = useColorMode();
const icon = isInternalUrl(item.href) ? <FontAwesomeIcon icon={faBook} style={{marginRight: "0.5em"}} color={colorMode === 'dark' ? '#7ecfee' : '#0033a1'} /> : <FontAwesomeIcon icon={faArrowUpRightFromSquare} style={{marginRight: "0.5em"}} color={colorMode === 'dark' ? '#7ecfee' : '#0033a1'} />;
const icon = isInternalUrl(item.href) ? <FontAwesomeIcon icon={faBook} className={styles.docCardIcon} /> : <FontAwesomeIcon icon={faArrowUpRightFromSquare} className={styles.docCardIcon} />;
const doc = useDocById(item.docId ?? undefined);
return (
<CardLayout
Expand Down
5 changes: 5 additions & 0 deletions src/theme/DocCard/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@
.cardDescription {
font-size: 0.9rem;
}

.docCardIcon {
margin-right: .5em;
color: var(--ifm-color-primary);
}
Loading