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

Correctly applied styles to Figure component in docs #6894

Merged
merged 1 commit into from
Apr 19, 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
5 changes: 2 additions & 3 deletions website/src/components/Figure/Figure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@
// biome-ignore lint/style/useImportType: <explanation>
import React from 'react';
import useBaseUrl from '@docusaurus/useBaseUrl';

import './styles.module.css';
import styles from './styles.module.css';

type Props = {
// An optional alt text, if the caption does not already convey all relevant
Expand All @@ -81,7 +80,7 @@ type Props = {

const Component: React.FC<Props> = ({ img, alt, caption }) => {
return (
<figure>
<figure className={styles.figure}>
<img alt={alt} src={useBaseUrl(img)} />
<figcaption>{caption}</figcaption>
</figure>
Expand Down
8 changes: 4 additions & 4 deletions website/src/components/Figure/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
/* Figures (with captions) */
.main-wrapper figure {
.figure {
box-shadow: var(--ifm-global-shadow-lw);
border-radius: var(--ifm-global-radius);
border: var(--ifm-global-border-width) solid var(--unleash-color-gray);
padding: var(--ifm-pre-padding);
margin-inline: 0;
}

figure img {
.figure img {
box-shadow: none;
border: none;
}

figure * + * {
.figure * + * {
margin-block-start: var(--ifm-pre-padding);
}

figcaption {
.figure figcaption {
font-size: var(--unleash-font-size-smaller);
padding-inline: var(--ifm-pre-padding);
border-inline-start: 5px solid var(--ifm-color-primary);
Expand Down
Loading