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

391/v2 button styling #397

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open

391/v2 button styling #397

wants to merge 16 commits into from

Conversation

nichgalzin
Copy link
Contributor

Description

**Relates #390 & Closes #391 **

This pull request includes a new MainButton component and its associated stories, as well as a minor update to the global CSS file to improve accessibility. The most important changes are detailed below.

MainButton Component:

  • New MainButton Component: Introduced a new MainButton component with various props to handle different button states and styles, including variant, size, colour, lightMode, type, disabled, and clickHandler. The component also includes default values and styles for each prop. (components/buttons/MainButton/MainButton.tsx)

Storybook Stories:

  • Storybook Stories for MainButton: Added comprehensive Storybook stories for the MainButton component, showcasing different button states such as default, large, small, mobile, secondary, tertiary, light mode, and disabled. Each story includes appropriate args and a play function to test button interactions. (components/buttons/MainButton/MainButton.stories.ts)

Global CSS:

  • Accessibility Improvement: Updated the global CSS to include an outline-offset for the :focus-visible state to improve accessibility by making the focus outline more visible. (app/globals.css)

UI changes

Screenshot 2025-01-17 at 16 56 43

Component with props to match the above styling.

Tests

Storybook tests and stories as outline above.

Intended to act as the main button used on the site, controls styling
and variations with props, and attempts to enforce consistency,
reusability and accessibility
Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for cool-creponne-3e1272 ready!

Name Link
🔨 Latest commit 19b4c40
🔍 Latest deploy log https://app.netlify.com/sites/cool-creponne-3e1272/deploys/6797a037344cb00008faab1b
😎 Deploy Preview https://deploy-preview-397--cool-creponne-3e1272.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@camelPhonso camelPhonso left a comment

Choose a reason for hiding this comment

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

Babes, marked it as a request changes because I think we should avoid all that styling in the component file and it's definitely a better practice to extend native prop types over emulating them ourselves.

But overall I think making this a component is overkill but you might have been thinking of enforcing accessibility practices maybe ( ? ) so let me know what you think.

Good, nice, comprehensive documentation - I appreciate it much ✨

components/buttons/MainButton/MainButton.tsx Outdated Show resolved Hide resolved
components/buttons/MainButton/MainButton.tsx Outdated Show resolved Hide resolved
components/buttons/MainButton/MainButton.tsx Show resolved Hide resolved
components/buttons/MainButton/MainButton.tsx Outdated Show resolved Hide resolved
components/buttons/MainButton/MainButton.tsx Show resolved Hide resolved
components/buttons/MainButton/MainButton.tsx Outdated Show resolved Hide resolved
tailwind.config.js Show resolved Hide resolved
app/globals.css Show resolved Hide resolved
components/buttons/MainButton/MainButton.stories.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@camelPhonso camelPhonso left a comment

Choose a reason for hiding this comment

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

that'll do

Thanks babe (see what I did there), I think the compromise will do well

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.

Button styles for Figma Design v2
3 participants