Skip to content

ActionList Component: Primer CSS Implementation #1657

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

Merged
merged 86 commits into from
Nov 2, 2021
Merged

ActionList Component: Primer CSS Implementation #1657

merged 86 commits into from
Nov 2, 2021

Conversation

langermank
Copy link
Contributor

@langermank langermank commented Oct 4, 2021

ActionList CSS

The Primer CSS implementation of Action List
Interface guidelines
Figma documentation
React

File structure
src/actionlist

  • action-list.scss: ul styles
  • action-list-item.scss: li and contents styles (the biggie)
  • action-list-item-divider.scss: li as divider styles

I broke the CSS into separate files by "component" level because I've heard some talk of encapsulating styles. I can move everything into one file if that's standard.

docs/src/stories/components/ActionList

Each individual component level has its own story which creates a "template". I'm then using that template SomeTemplate.bind({}) in feature/pattern stories to showcase every possible variation of Action List

Code review

  • Feel free to ignore .jsx story files for review, they are for documentation and development
  • Looking for feedback on the following:
    • Nesting
    • BEM (how'd I do?)
    • Performance (any red flags?)
    • Support (did I include any new CSS properties we don't support?)
    • Visual review when Storybook is deployed

TODO:

  • Pull in primitive update + remove custom variables Add actionListItem variables primitives#256
  • Reconcile action-list-helpers-temporary.scss and figure out what to do with proposed variable additions (should they be global or just used in action list)
  • Deploy Storybook for stress testing
  • Finish up docs
  • Upgrade primitives + fix disabled color var Release Tracking primitives#263

Fixes: https://github.com/github/primer/issues/4

/cc @primer/css-reviewers

Sorry, something went wrong.

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2021

🦋 Changeset detected

Latest commit: d6dd77c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

storybook: https://primer.style/css/storybook/?path=/story/components-actionlist-actionlistitem--playground
---

Reference the [Action list interface guidelines](https://primer.style/design/components/action-list) for details on where and how to use Action List.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this description enough? I feel like I would just be repeating the interface guideline, but I could pull some snippets from it

@@ -17,7 +17,7 @@
"@primer/gatsby-theme-doctocat": "2.0.0",
"@primer/octicons": "16.1.0",
"@primer/octicons-react": "16.0.0",
"@primer/primitives": "6.0.0",
"@primer/primitives": "6.1.0-rc.9f1f534",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Temporary- will update with next release

@@ -0,0 +1,428 @@
// stylelint-disable selector-max-specificity, max-nesting-depth, primer/spacing, no-duplicate-selectors
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll review where I'm super duper nesting and using a lot of specificity.. but I think I need to with this component. Its designed to be pretty smart and recognize whats going on in the dom/make decisions, but maybe its too expensive 🤷

// stylelint-disable selector-max-specificity, max-nesting-depth, primer/spacing, no-duplicate-selectors
@import './action-list-variables.scss';

@mixin focusOutline {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could pull out this mixin in the future if we roll out more global focus styles

}
}

// place children on grid
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This section creates the duplicate class selectors, but I think its nice having the grid defs pulled out together

visibility: hidden;
opacity: 0;
transition:
visibility 0 linear $actionList-item-checkmark-transition-timing,
Copy link
Contributor

Choose a reason for hiding this comment

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

is this indentation correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thats what stylelint wants 🤷

@@ -399,6 +403,9 @@
.ActionList-item-label {
position: relative; // for pseudo dividers
font-weight: $font-weight-normal;
// we need a strict value here for grid alignment
// stylelint-disable-next-line primer/typography
line-height: $actionList-item-label-line-height;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

line-height 20px

 Conflicts:
	docs/package.json
	docs/yarn.lock
	package.json
	yarn.lock

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Member

@jonrohan jonrohan left a comment

Choose a reason for hiding this comment

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

This is looking really great 🌈

Approving! 👍🏻 Feel free to merge, whenever you feel like the API/naming works with what we're implementing in dotcom.

@langermank langermank merged commit e754300 into main Nov 2, 2021
@langermank langermank deleted the actionlist branch November 2, 2021 15:37
@primer-css primer-css mentioned this pull request Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants