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

Support for complete token refurbishment #144

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

8845musign
Copy link
Collaborator

@8845musign 8845musign commented Dec 19, 2024

Changes

  • Support for complete token refurbishment
  • I test by comparing the Storybook before and after applying the token on every page.

Check

  • Browser verification (minimum) Android Chrome/iOS Safari(375px-) Almost only colour change
  • CSS not affected by inheritance
  • Layout does not break even if there is an overflow
  • Layout does not break when wraps
  • Added new Component
    • Added data-* prop and id prop
  • Updated Ubie Vitals or Added an update issue(if needed)

@8845musign 8845musign marked this pull request as draft December 19, 2024 04:39
@@ -12,53 +12,11 @@
line-height: var(--text-leading);
color: var(--text-color);
overflow-wrap: anywhere;
background-color: var(--background-color);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed from specifying variations by class to CSS Variables
In the future, if the number of variations increases or decreases, the number of changes will be reduced.

@@ -32,7 +32,7 @@
}

.button:focus-visible {
outline: solid var(--color-accent) 2px;
outline: solid var(--focus-ring, var(--color-border-blue-darken)) 2px;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the focus-ring, pink is only used when the component color is blue. While blue is the basic color, it is used exceptionally as another color.

background-color: var(--color-primary);
}
border: 0;
border-top: var(--border-width) solid var(--border-color);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Change from class to CSS Variables

@@ -55,7 +55,7 @@ type Props = {
* 子要素の間隔。指定しない場合は0
* xxs=4px, xs=8px, sm=12px, md=16px, lg=24px, xl=40px, xxl=64px
*/
spacing: Spacing;
spacing?: Spacing;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When the spacing notation was supported, the absence of spacing was no longer acceptable.
I've changed it back to optional.

@@ -84,6 +69,11 @@
text-decoration: underline;
}

.heading.xxs {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add Size Variation

/**
* アイコン。プライマラーカラーで表示。icon propはどれかひとつのみを指定してください
*/
primaryIcon?: ReactNode;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deleted because the icon was not used.

@@ -3,7 +3,7 @@
font-weight: normal;
hyphens: auto;
line-height: var(--leading);
color: var(--color);
color: var(--text-color);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the CSS file, I was using variables to make the specification. However, this time I made the colour specification directly from JavaScript.

@@ -1,16 +1,28 @@
export type FontSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
export type FontSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This file defines the variations of most components.

@@ -117,29 +123,61 @@ export const cssLeadingToken = ({
return '';
};

export const colorVariable = (color: TextColor | undefined): CSSProperties => {
const PascalToKebab = (str: string) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The functions in this file convert the colour keys specified in the component to CSS Variables.

@8845musign 8845musign self-assigned this Dec 19, 2024
@@ -127,5 +127,8 @@
"dependencies": {
"@react-docgen/cli": "^2.0.4",
"debounce": "^2.1.1"
},
"optionalDependencies": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

GitHub Actions fails to install this package. Even if it fails, the process can continue.

ref: npm/cli#4828

@8845musign 8845musign marked this pull request as ready for review December 19, 2024 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant