Skip to content

Spike: Button with css #3065

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

Closed
wants to merge 36 commits into from
Closed

Spike: Button with css #3065

wants to merge 36 commits into from

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Mar 22, 2023

Going to test this with dotcom

Bundled css as into one file, needs to be imported explicitly

import {Button} from '@primer/react/lib-esm/drafts/Button2'
import '@primer/react/lib-esm/components.css'

@changeset-bot

This comment was marked as off-topic.

@siddharthkp siddharthkp self-assigned this Mar 22, 2023
@siddharthkp siddharthkp added the skip changeset This change does not need a changelog label Mar 22, 2023
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 March 22, 2023 20:22 Inactive
@primer primer bot temporarily deployed to github-pages March 22, 2023 20:23 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 March 22, 2023 20:23 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Mar 22, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 121.24 KB (+0.07% 🔺)
dist/browser.umd.js 121.54 KB (+0.07% 🔺)

@siddharthkp siddharthkp temporarily deployed to github-pages March 22, 2023 22:40 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 March 22, 2023 22:41 Inactive
@siddharthkp siddharthkp temporarily deployed to github-pages March 23, 2023 00:04 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 March 23, 2023 00:04 Inactive
@siddharthkp siddharthkp temporarily deployed to github-pages March 23, 2023 00:13 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 March 23, 2023 00:13 Inactive
@@ -9,6 +9,10 @@ module.exports = {
'@storybook/addon-interactions',
'@storybook/addon-a11y',
'@storybook/addon-links',
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

css modules setup for storybook

@@ -2,6 +2,9 @@ import {addons} from '@storybook/addons'
import {withThemeProvider, withSurroundingElements, toolbarTypes} from '../src/utils/story-helpers'
import {PrimerBreakpoints} from '../src/utils/layout'

import '@primer/css/dist/primitives.css'
import '@primer/css/dist/color-modes.css'
Copy link
Member Author

@siddharthkp siddharthkp Apr 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: dependency on css variables from primitives!

@@ -1580,16 +1580,6 @@
"type": "| 'small'\n| 'medium'\n| 'large'",
"defaultValue": "'medium'"
},
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unintentional change!

@@ -1,2 +1,5 @@
// eslint-disable-next-line no-var
declare var __DEV__: boolean

// supress type warnings for css files
declare module '*.module.css'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript not happy with css imports, there probably is a better way to do this, but this works for now

lineHeight={lineHeight}
data-color-mode={primerColorModeToPrimitiveColorMode[colorMode || defaultColorMode]}
data-light-theme={dayScheme}
data-dark-theme={nightScheme}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: theming support for primitives

@siddharthkp siddharthkp temporarily deployed to github-pages April 25, 2023 14:52 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 April 25, 2023 14:52 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 April 25, 2023 15:02 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 April 25, 2023 15:04 Inactive
@primer primer bot temporarily deployed to github-pages April 25, 2023 15:09 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3065 April 25, 2023 15:09 Inactive
@@ -0,0 +1,203 @@
.button {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason to rewrite this CSS instead of using what we already have from PVC? https://github.com/primer/view_components/blob/main/app/components/primer/beta/button.pcss

I think its harder to read this file with the custom CSS vars and overrides. I also think we should continue to use BEM for this test, and then if we move forward with CSS Modules write an ADR about how we want to name classes.

@siddharthkp
Copy link
Member Author

siddharthkp commented Apr 26, 2023

This PR is busted 😢, going to close it and start over from main

@langermank, saw your comment, will copy it on the new PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changeset This change does not need a changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants