mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-15 01:16:22 +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>
|
||||
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
|
||||
@ -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>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* 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);
|
||||
@ -7,16 +7,16 @@
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user