Skip to content

Conversation

@jschuler
Copy link
Collaborator

@jschuler jschuler commented Apr 20, 2020

ddonahue007
ddonahue007 previously approved these changes Apr 20, 2020
Copy link
Member

@ddonahue007 ddonahue007 left a comment

Choose a reason for hiding this comment

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

LGTM

@gdoyle1 gdoyle1 self-requested a review April 20, 2020 18:30
Copy link
Contributor

@gdoyle1 gdoyle1 left a comment

Choose a reason for hiding this comment

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

@jschuler This looks SO much better. Can we move the chart colors table above the fonts table on the Documentation / CSS variables page?

As we discussed through Slack, I'll make a follow-up issue to continue iterating on the organization of that page

redallen
redallen previously approved these changes Apr 20, 2020
Copy link
Contributor

@redallen redallen left a comment

Choose a reason for hiding this comment

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

Just some nitpicking for readability. Also not sure how we're fixing this problem without collapsing the side nav at a wider breakpoint:
image

Good job @jschuler !

this.prefix =
typeof props.prefix === "string" ? [props.prefix] : props.prefix;
const applicableFiles = Object.entries(tokensModule)
.filter(([key, val]) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

What about:

const prefixTokens = this.prefix.map(prefix => prefix.replace("pf-", "").replace(/-+/g, "_")
const applicableFiles = Object.entries(tokensModule)
  .filter(([key, _val]) => prefixTokens.includes(key)

}
];

this.columns = this.columns.concat([
Copy link
Contributor

Choose a reason for hiding this comment

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

I like avoiding destructuring for performance, but using it is a more readable:

this.columns = [
  ...props.hideSelectorColumn ? [] : [{
     title: "Selector",
     transforms: [sortable],
     cellFormatters: [expandable]
  }]
  { title: "Variable", transforms: [sortable] },
  { title: "React Token", transforms: [sortable] },
  { title: "Value", transforms: [sortable] }
]

}
};

this.getFilteredRows = this.getFilteredRows.bind(this);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to bind? Are class members not bound automagically? :(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed for the first 2, last one I changed the function to use arrow syntax so also not needed anymore, thanks

(val.values && searchRE.test(JSON.stringify(val.values)));
if (passes) {
const rowKey = `${selector}_${val.property}`;
let cells = this.props.hideSelectorColumn ? [] : [selector];
Copy link
Contributor

Choose a reason for hiding this comment

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

Same thing with destructuring

@jschuler jschuler dismissed stale reviews from redallen and ddonahue007 via e31ab18 April 20, 2020 22:10
@jschuler
Copy link
Collaborator Author

Thanks for the review @redallen , addressing your comments now

@jschuler
Copy link
Collaborator Author

@redallen , I've addressed your comments and I also changed the grid breakpoints for CSS variables and props to grid-lg (as opposed to grid-md the default) so that they break sooner

Copy link
Contributor

@redallen redallen left a comment

Choose a reason for hiding this comment

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

Looking good like it should! CI is failing because it can't download yarn, I don't think anything is wrong with the code. I'd love to get this in for this release.

@redallen redallen dismissed gdoyle1’s stale review April 21, 2020 16:14

Gina told me the order was her only concern and that it's fixed!

@redallen redallen merged commit eea6e26 into master Apr 21, 2020
@nicolethoen nicolethoen deleted the update-css-vars branch February 8, 2023 13:41
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.

Make react-tokens map to SCSS variable and palette color

5 participants