Skip to content

Commit

Permalink
extract to css?
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov committed Oct 12, 2024
1 parent 120204f commit d758651
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 30 deletions.
34 changes: 4 additions & 30 deletions site/src/components/SectionFeatures/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { useColorMode } from '@docusaurus/theme-common'
import { gray } from '@radix-ui/colors'
import type { SVGProps } from 'react'
import clsx from 'clsx'
import styles from './styles.module.css'
Expand Down Expand Up @@ -92,40 +90,16 @@ function TickIcon(props: SVGProps<SVGSVGElement>) {
}

function Feature({ title, description }: FeatureItem) {
const { colorMode, isDarkTheme } = useColorMode()
console.log({ colorMode, isDarkTheme })

return (
<div className={clsx('col col--6')} style={{ padding: 10 }}>
<div className="padding-horiz--md">
<h3
style={{
color: isDarkTheme ? gray.gray4 : gray.gray12,
display: 'inline-flex',
alignItems: 'center',
gap: 8,
}}
>
<span
style={{
display: 'grid',
placeItems: 'center',
color: 'red',
width: 20,
height: 20,
fontSize: 12,
background: 'var(--sky7)',
borderRadius: 100,
border: `1px solid var(--sky10)`,
}}
>
<TickIcon style={{ width: 12, height: 12, fill: 'var(--sky12)' }} />
<h3 className={styles['feature-title']}>
<span className={styles['tick-container']}>
<TickIcon className={styles['tick-icon']} />
</span>
{title}
</h3>
<p style={{ color: isDarkTheme ? gray.gray8 : gray.gray11 }}>
{description}
</p>
<p className={styles['feature-description']}>{description}</p>
</div>
</div>
)
Expand Down
36 changes: 36 additions & 0 deletions site/src/components/SectionFeatures/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,39 @@
min-height: 80vh;
padding: 64px 0;
}

.feature-title {
align-items: center;
color: var(--gray12);
display: inline-flex;
gap: 8px;
}

[data-theme='dark'] .feature-title {
color: var(--gray4);
}

.tick-container {
background-color: var(--sky7);
border: 1px solid var(--sky10);
border-radius: 100%;
display: grid;
font-size: 12px;
height: 20px;
place-items: center;
width: 20px;
}

.tick-icon {
height: 12px;
fill: var(--sky12);
width: 12px;
}

.feature-description {
color: var(--gray11);
}

[data-theme='dark'] .feature-description {
color: var(--gray8);
}

0 comments on commit d758651

Please sign in to comment.