Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move basic default CSS out of theme. Improve StoryBook intro page #5791

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/components/.storybook/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion packages/components/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const config: StorybookConfig = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-mdx-gfm',
],
framework: {
name: '@storybook/react-vite',
Expand Down
6 changes: 6 additions & 0 deletions packages/components/.storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { addons } from '@storybook/manager-api';
import theme from './theme';

addons.setConfig({
theme,
});
2 changes: 2 additions & 0 deletions packages/components/.storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './storybook-base.css';

export const parameters = {
backgrounds: {
default: 'light',
Expand Down
15 changes: 15 additions & 0 deletions packages/components/.storybook/storybook-base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* Base styles */
:root {
--basic-font-family: system-ui;
--basic-font-size: 16px;
background: var(--background-color);
font-family: var(--basic-font-family);
font-size: var(--basic-font-size);
line-height: 1.5;
}

.sbdocs.sbdocs-content {
p {
font-size: 16px;
}
}
10 changes: 10 additions & 0 deletions packages/components/.storybook/theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { create } from '@storybook/theming/create';
import logo from './Logo.svg';

export default create({
base: 'light',
brandTitle: '@plone/components StoryBook',
brandUrl: 'https://plone-components.netlify.app/',
brandImage: logo,
brandTarget: '_self',
});
1 change: 1 addition & 0 deletions packages/components/news/5791.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Move basic general CSS rules to StoryBook so we don't spoil the build @sneridagh
1 change: 1 addition & 0 deletions packages/components/news/5791.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve StoryBook look and feel @sneridagh
2 changes: 2 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@
"@storybook/addon-links": "^7.5.1",
"@storybook/addon-mdx-gfm": "^7.5.1",
"@storybook/blocks": "^7.5.1",
"@storybook/manager-api": "^7.6.17",
"@storybook/react": "^7.5.1",
"@storybook/react-vite": "^7.5.1",
"@storybook/testing-library": "^0.2.2",
"@storybook/theming": "^7.6.17",
"@testing-library/jest-dom": "6.1.4",
"@testing-library/react": "14.0.0",
"@types/jest-axe": "^3.5.7",
Expand Down
35 changes: 35 additions & 0 deletions packages/components/src/stories/Introduction.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Meta } from '@storybook/blocks';

<Meta title="Introduction" />


# `@plone/components`

This package contains ReactJS components for using Plone as a headless CMS.

The purpose of this package is to provide an agnostic set of baseline components to build Plone sites upon.

## Usage

Using the package manager of your choice (npm, yarn, pnpm) install the package:

```shell
yarn add @plone/components
```

Whenever you want to use the components, all are exported as named exports:

```ts
import { TextField } from '@plone/components';

const MyComponent = (props) => {
return (
<>
<TextField label="Username" />
</>;
)
}

export default MyComponent;
```

10 changes: 0 additions & 10 deletions packages/components/src/styles/basic/theme.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
@import '../quanta/colors.css';

/* Base styles */
:root {
--basic-font-family: system-ui;
--basic-font-size: 14px;
background: var(--background-color);
font-family: var(--basic-font-family);
font-size: var(--basic-font-size);
line-height: 1.5;
}

/* color themes for dark and light modes, generated with Leonardo.
* Light: https://leonardocolor.io/theme.html?name=Light&config=%7B%22baseScale%22%3A%22Gray%22%2C%22colorScales%22%3A%5B%7B%22name%22%3A%22Gray%22%2C%22colorKeys%22%3A%5B%22%23000000%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Purple%22%2C%22colorKeys%22%3A%5B%22%235e30eb%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%2C%7B%22name%22%3A%22Red%22%2C%22colorKeys%22%3A%5B%22%23e32400%22%5D%2C%22colorspace%22%3A%22RGB%22%2C%22ratios%22%3A%5B%22-1.12%22%2C%221.45%22%2C%222.05%22%2C%223.02%22%2C%224.54%22%2C%227%22%2C%2210.86%22%5D%2C%22smooth%22%3Afalse%7D%5D%2C%22lightness%22%3A98%2C%22contrast%22%3A1%2C%22saturation%22%3A100%2C%22formula%22%3A%22wcag2%22%7D */
:root {
Expand Down
82 changes: 82 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading