1
0
Fork 0

wip: Bunch of changes for v4

From the top of my head (but I'll write this up later):

- We keep the info about the designs in the design
- We use a new about.json file for this
- The auto-generated data.mjs file is no more
- Linedrawings we use in the design picker use the front
- Linedrawings should respect square aspect ration
- Migrated components to use the 'tw-' prefic for tailwind CSS classes
  to avoid conflicts with docusaurus styles
This commit is contained in:
joostdecock 2024-12-26 18:33:49 +01:00
parent 6b8eea2724
commit c8808695e5
255 changed files with 3038 additions and 2304 deletions

View file

@ -1,38 +1,29 @@
import React from 'react'
import { LineDrawingWrapper, regular, thin } from './shared.mjs'
const strokeScale = 0.5
/*
* This strokeScale factor is used to normalize the stroke across
* designs so we have a consistent look when showing our collection
*/
const strokeScale = 1
export const Benjamin = ({
className = 'w-64', // CSS classes to apply
stroke = 1, // Stroke width to use
}) => {
// Normalize stroke across designs
stroke = stroke * strokeScale
return (
<LineDrawingWrapper viewBox="0 0 138 53" {...{ className, stroke }}>
<Front stroke={stroke} />
</LineDrawingWrapper>
)
}
/**
* A linedrawing component for Benjamin
*
* @param {object} props - All React props
* @param {string} props.className - Any CSS classes to apply
* @param {number} props.stroke - The stroke width to apply
*/
export const Benjamin = ({ className, stroke = 1 }) => (
<LineDrawingWrapper viewBox="0 -44 138 138" {...{ className, stroke }}>
<Front stroke={stroke * strokeScale} />
</LineDrawingWrapper>
)
/*
* React component for the front
* Front is the same
*/
export const BenjaminFront = ({
className = 'w-64', // CSS classes to apply
stroke = 1, // Stroke width to use
}) => {
// Normalize stroke across designs
stroke = stroke * strokeScale
return (
<LineDrawingWrapper viewBox="0 0 138 53" {...{ className, stroke }}>
<Front stroke={stroke} />
</LineDrawingWrapper>
)
}
export const BenjaminFront = Benjamin
/*
* SVG elements for the front