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

Update: Add all CE Colors and Storybook Docs #294

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

Conversation

dylanbox
Copy link

@dylanbox dylanbox commented Aug 23, 2024

Overview

Adds all of the CE colors to the MDHUI library. Colors are namespaced as --mdhui-[color]-[shade] to keep with current naming scheme. Additionally, adds a page on the storybook for documentation purposes.

image

Security

REMINDER: All file contents are public.

  • I have ensured no secure credentials or sensitive information remain in code, metadata, comments, etc.
    • Please verify that you double checked that .storybook/preview.js does not contain your participant access key details.
    • There are no temporary testing changes committed such as API base URLs, access tokens, print/log statements, etc.
  • These changes do not introduce any security risks, or any such risks have been properly mitigated.

Only adds css variables, no additional data added or endpoints.

Checklist

Testing

Documentation

  • I have added relevant Storybook updates to this PR as well.
  • If this feature requires a developer doc update, tag @CareEvolution/api-docs.

Consider "Squash and merge" as needed to keep the commit history reasonable on main.

Reviewers

Assign to the appropriate reviewer(s). Minimally, a second set of eyes is needed ensure no non-public information is published. Consider also including:

  • Subject-matter experts
  • Style/editing reviewers
  • Others requested by the content owner

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive set of CSS variables and gradients for enhanced styling options throughout the application.
    • Added a new component to visually represent color shades and their organization in the user interface.
    • Created a documentation interface for color palettes and gradients to facilitate easy reference for developers.
  • Documentation

    • Improved the presentation of color-related components with new styles and layout enhancements.

@dylanbox dylanbox requested a review from n400 August 23, 2024 18:05
Copy link
Contributor

coderabbitai bot commented Aug 23, 2024

Walkthrough

The changes introduce a substantial addition of CSS variables and gradients in the globalCss.ts file, enhancing the application's styling capabilities. New CSS styles for presenting color components are added in colorDocs.css, while colorDocs.tsx provides a structured way to document and visualize colors and their shades within a React component.

Changes

Files Change Summary
src/helpers/globalCss.ts Added CSS variables for a comprehensive color palette and gradient definitions, reorganized under :root.
src/stories/foundation/colorDocs.css Introduced styles for color presentation, including layout for color cells and responsive design.
src/stories/foundation/colorDocs.tsx Implemented a React component to display colors and shades in a structured format, including gradients.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 28b1e2c and ee1776e.

Files selected for processing (3)
  • src/helpers/globalCss.ts (2 hunks)
  • src/stories/foundation/colorDocs.css (1 hunks)
  • src/stories/foundation/colorDocs.tsx (1 hunks)
Additional comments not posted (18)
src/stories/foundation/colorDocs.css (11)

1-6: LGTM!

The .colorCell class correctly sets up a flex container with centered content stacked vertically.


8-12: LGTM!

The .colorCell .color class correctly sets a fixed size for the color swatch and centers it horizontally.


15-18: LGTM!

The .colorCell .shade class correctly sets the text color and size for the shade label.


20-24: LGTM!

The .colorRow class correctly sets up a flex container for color cells with top padding.


26-28: LGTM!

The .colorHeader class correctly sets a minimum width for the color header.


30-32: LGTM!

The .colorHeader code class correctly sets the font size for code elements within the color header.


34-40: LGTM!

The .colorRow .colors class correctly sets up a flex container for color cells with wrapping, a gap, and a maximum width.


42-44: LGTM!

The .colorRow h3 class correctly sets a minimum width for h3 elements within the color row.


46-48: LGTM!

The .gradients class correctly adds top padding to the gradients section.


50-52: LGTM!

The .gradients .colorRow class correctly adds a top border to the color row within the gradients section.


54-63: LGTM!

The .gradientCells .colorCell .color class correctly sets a larger size for the color swatch within gradient cells.

The .gradientCells class correctly sets up a flex container for gradient cells with wrapping and a gap.

src/stories/foundation/colorDocs.tsx (4)

47-57: LGTM!

The ColorCell component is correctly implemented and effectively displays a color shade using the provided hue and shade props.


63-79: LGTM!

The ColorRow component is correctly implemented and effectively displays a row of color shades for a given hue. The component also provides a clear header with the hue name and CSS variable usage example.


81-107: LGTM!

The GradientSection component is correctly implemented and effectively displays a section of gradients. The component provides a clear header with a description of the gradient versions and CSS variable usage example.


109-124: LGTM!

The ColorDocs component is correctly implemented and effectively orchestrates the layout of the color documentation. The component provides a clear header with a description of the color shades and CSS variable usage example. It also correctly renders the ColorRow components for each hue and the GradientSection at the end.

src/helpers/globalCss.ts (3)

55-290: Excellent work on defining the base colors!

The base color definitions provide a comprehensive set of colors organized into intuitive color families. The wide range of shades offers granular control over color usage. The naming convention is consistent and aligns with the existing pattern.


292-524: Great job on defining the light mode colors!

Referencing the base color variables for light mode colors is a smart approach. It allows for seamless switching between light and dark themes. The color families and shades maintain consistency with the base color definitions. The naming convention is intuitive and follows the established pattern.


525-545: Fantastic work on defining the gradients!

The gradient definitions add a visually appealing dimension to the application's styling. Providing both light and dark variants demonstrates thoughtfulness in accommodating different themes. The naming convention is descriptive and clearly distinguishes between the light and dark versions.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@n400
Copy link

n400 commented Aug 23, 2024

not sure if we need the gradients in there. i will add some verbiage to describe the "magic numbers" contrast-based system for accessibility

}

:root {
/* Light mode questions */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this comment accurate? I'm not sure what it means. Should there be a "dark mode" counterpart?


:root {
/* BASE-COLORS */
--mdhui-grey-1-base: rgb(251, 252, 252);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm curious why we have the base variables? What does having a "base" color variable and then a 1:1 mapping with the actual color variables do for us?

Copy link
Author

Choose a reason for hiding this comment

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

It's for enabling dark/light mode when we want to do that. The non "base" color variable gets assigned with whatever the current color palette is.

--mdhui-gradient-early-bird: linear-gradient(180deg, 0% rgba(34, 159, 185), 100% rgba(143, 130, 246));
--mdhui-gradient-evergreen-petrichor: linear-gradient(180deg, 0% rgba(34, 159, 185), 100% rgba(0, 123, 108));
}`

Copy link
Collaborator

Choose a reason for hiding this comment

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

Minor: Extra newline and we lost the semicolon here.

Copy link
Collaborator

@reneefromhold reneefromhold left a comment

Choose a reason for hiding this comment

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

I echo the same question from Garret about having base variables.

@dylanbox Can the gradients be added to the story?

@dylanbox
Copy link
Author

dylanbox commented Sep 5, 2024

Yeah we can add the gradients to the story, I'll push that up in a sec

@dylanbox
Copy link
Author

dylanbox commented Sep 6, 2024

@reneefromhold @greinard @n400 that's up

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.

4 participants