8000 feat(CodeEditor): apply tokens by kmcfaul · Pull Request #6199 · patternfly/patternfly · GitHub
[go: up one dir, main page]

Skip to content

feat(CodeEditor): apply tokens#6199

Merged
mcoker merged 9 commits intopatternfly:v6from
kmcfaul:codeeditor-penta
Feb 8, 2024
Merged

feat(CodeEditor): apply tokens#6199
mcoker merged 9 commits intopatternfly:v6from
kmcfaul:codeeditor-penta

Conversation

@kmcfaul
Copy link
Contributor
@kmcfaul kmcfaul commented Jan 8, 2024

Todos/questions -

  • Header controls look a little off when updated to icon buttons. I put in a couple overrides but it's not quite there. Adjusting the padding/flex properties to match Figma better causes some weird alignment issues with the backgrounds/border. It also seems like we may still need hover styling for the icon buttons?
  • View shortcuts button hover is covering/removing the header border
  • Need to figure out how to update the docs to use icon buttons and new pf-m-plain modifier (will probably be a follow up)

Update: should be matching figma.

@patternfly-build
Copy link
Collaborator 8000
patternfly-build commented Jan 8, 2024

@kmcfaul kmcfaul linked an issue Jan 16, 2024 that may be closed by this pull request
@kmcfaul
Copy link
Contributor Author
kmcfaul commented Jan 17, 2024

Renamed vars, cleaned up padding on header-content, added padding to code block

Copy link
Collaborator
@andrew-ronaldson andrew-ronaldson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member
@srambach srambach left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM! Left a couple of comments, neither are blockers. If you agree anything should change, we can open a follow-up if issue for post-alpha you'd prefer.

8000
border-radius: var(--#{$code-editor}__tab--BorderRadius) 0 0 0;

&.pf-m-plain {
--#{$code-editor}__header-content--BackgroundColor: var( --#{$code-editor}__header-content--m-plain--BackgroundColor);
Copy link
Contributor

Choose a reason for hiding this comment

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

small nit.

Suggested change
--#{$code-editor}__header-content--BackgroundColor: var( --#{$code-editor}__header-content--m-plain--BackgroundColor);
--#{$code-editor}__header-content--BackgroundColor: var(--#{$code-editor}__header-content--m-plain--BackgroundColor);

Also I wonder if this .pf-m-plain modifier might be better on .#{$code-editor}__header in case we add more "plain" styles or do something like move the background color from .#{$code-editor}__header-content and add it to .#{$code-editor}__header? Not a blocker or anything though.

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 moved the plain modifier up to __header. I think the background color needs to remain on the header-content though, because moving it up to the header was creating a grey background when it shouldn't (like when there's no header only the language tab).

Copy link
Contributor

Choose a reason for hiding this comment

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

@kmcfaul thanks, perfect!

background-color: var(--#{$code-editor}__main--BackgroundColor);
border: var(--#{$code-editor}__main--BorderWidth) solid;
border-color: var(--#{$code-editor}__main--BorderColor);
border-radius: 0 0 var(--#{$code-editor}__tab--BorderRadius) var(--#{$code-editor}__tab--BorderRadius);
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like we have __tab--BorderRadius defined on __main, __header-content, and __tab. That means to change any of them, a user will set --#{$code-editor}__tab--BorderRadius.

If we decide to give main (as an example) a unique border-radius via --#{$code-editor}__main--BorderRadius, then --#{$code-editor}__tab--BorderRadius will no longer control __main's border-radius. If a user themed --#{$code-editor}__tab--BorderRadius, that will no longer style __main, which is technically a breaking change.

That logic and what we consider a breaking change may change as we nail down the definition of what what a breaking change is in core now that we have such a rich set of vars to style everything, but for now would you mind creating unique vars for __main, __header-content, and __tab?

BE9D
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I'll separate them out. I think the reason I went with a single variable was because conceptually the 3 create the rounded edges on the editor header together.

Copy link
Contributor
@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🐸👍

@mcoker mcoker merged commit 7441196 into patternfly:v6 Feb 8, 2024
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.0.0-alpha.77 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Consume tokens: Code editor

7 participants

0