Skip to content

Commit

Permalink
fix: removed extra commons.css generation
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Sep 8, 2023
1 parent 9ba0ed5 commit 95c28ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
5 changes: 0 additions & 5 deletions www/src/components/PageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ import { SettingsContext } from '../context/SettingsContext';
import LeaveFeedback from './LeaveFeedback';
import AutoToc from './AutoToc';

if (process.env.NODE_ENV === 'development') {
/* eslint-disable-next-line global-require */
require('~paragon-style/scss/core/core.scss');
}

export interface ILayout {
children: React.ReactNode,
showMinimizedTitle: boolean,
Expand Down
12 changes: 6 additions & 6 deletions www/src/pages/foundations/colors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export interface ISwatch {
isUnused?: boolean,
}

const styles = getComputedStyle(document.body);
const styles = typeof window !== 'undefined' ? getComputedStyle(document.body) : null;

function Swatch({ name, colorClassName, isUnused }: ISwatch) {
const computedValue = styles.getPropertyValue(name);
const computedValue = styles?.getPropertyValue(name);

return (
<div className="d-flex align-items-center mb-2">
Expand All @@ -71,6 +71,7 @@ function Swatch({ name, colorClassName, isUnused }: ISwatch) {
<code className="mb-0 d-block text-lowercase text-dark-700">
{`var(${name})`}
</code>

<code style={{ fontSize: '65%' }} className="text-muted">
{computedValue}
</code>
Expand Down Expand Up @@ -128,16 +129,15 @@ export default function ColorsPage({ data }: IColorsPage) {
{colors
.slice(0, 3)
.map(({ themeName, unusedLevels }) => renderColorRamp(themeName, unusedLevels))}
{colors
.slice(3)
.map(({ themeName, unusedLevels }) => renderColorRamp(themeName, unusedLevels))}
<div>
<p className="h5">accents</p>

<Swatch name="--pgn-color-accent-a" colorClassName="bg-accent-a" />
<Swatch name="--pgn-color-accent-b" colorClassName="bg-accent-b" />
</div>

{colors
.slice(3)
.map(({ themeName, unusedLevels }) => renderColorRamp(themeName, unusedLevels))}
</div>

<h3>CSS Color Usage</h3>
Expand Down

0 comments on commit 95c28ea

Please sign in to comment.