mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-24 01:18:01 +02:00
Correctly applied styles to Figure
component in docs (#6894)
It turns out the styles that we had in `style.modules.css` were overridden by browser defaults. ## Before  ## After  Now taking into account all the styles that were in the CSS files (notice margin and border)
This commit is contained in:
parent
2cb9ceaa72
commit
a71d794780
@ -66,8 +66,7 @@
|
|||||||
// biome-ignore lint/style/useImportType: <explanation>
|
// biome-ignore lint/style/useImportType: <explanation>
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||||
|
import styles from './styles.module.css';
|
||||||
import './styles.module.css';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
// An optional alt text, if the caption does not already convey all relevant
|
// An optional alt text, if the caption does not already convey all relevant
|
||||||
@ -81,7 +80,7 @@ type Props = {
|
|||||||
|
|
||||||
const Component: React.FC<Props> = ({ img, alt, caption }) => {
|
const Component: React.FC<Props> = ({ img, alt, caption }) => {
|
||||||
return (
|
return (
|
||||||
<figure>
|
<figure className={styles.figure}>
|
||||||
<img alt={alt} src={useBaseUrl(img)} />
|
<img alt={alt} src={useBaseUrl(img)} />
|
||||||
<figcaption>{caption}</figcaption>
|
<figcaption>{caption}</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Figures (with captions) */
|
/* Figures (with captions) */
|
||||||
.main-wrapper figure {
|
.figure {
|
||||||
box-shadow: var(--ifm-global-shadow-lw);
|
box-shadow: var(--ifm-global-shadow-lw);
|
||||||
border-radius: var(--ifm-global-radius);
|
border-radius: var(--ifm-global-radius);
|
||||||
border: var(--ifm-global-border-width) solid var(--unleash-color-gray);
|
border: var(--ifm-global-border-width) solid var(--unleash-color-gray);
|
||||||
@ -7,16 +7,16 @@
|
|||||||
margin-inline: 0;
|
margin-inline: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
figure img {
|
.figure img {
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
figure * + * {
|
.figure * + * {
|
||||||
margin-block-start: var(--ifm-pre-padding);
|
margin-block-start: var(--ifm-pre-padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
figcaption {
|
.figure figcaption {
|
||||||
font-size: var(--unleash-font-size-smaller);
|
font-size: var(--unleash-font-size-smaller);
|
||||||
padding-inline: var(--ifm-pre-padding);
|
padding-inline: var(--ifm-pre-padding);
|
||||||
border-inline-start: 5px solid var(--ifm-color-primary);
|
border-inline-start: 5px solid var(--ifm-color-primary);
|
||||||
|
Loading…
Reference in New Issue
Block a user