-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
chore: recorder button styling #19231
Changes from 1 commit
dadd42d
b10db57
860097c
635fabd
a1f9029
475a2df
bffe3e0
f6fcf31
a9732ad
0bf5988
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,15 +16,25 @@ | |
|
||
.toolbar-button { | ||
flex: none; | ||
border: none; | ||
outline: none; | ||
color: var(--vscode-sideBarTitle-foreground); | ||
background: transparent; | ||
padding: 4px; | ||
margin-left: 10px; | ||
cursor: pointer; | ||
display: inline-flex; | ||
align-items: center; | ||
border-radius: 6px; | ||
border: 1px solid var(--vscode-dropdown-border); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these seems to be best color for border for both light and dark mode as inspired by github buttons |
||
font-family: inherit; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are you resetting from? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
line-height: 20px; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already do flex + align items, why is this needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
white-space: nowrap; | ||
vertical-align: middle; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should not use this style in flex. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
cursor: pointer; | ||
appearance: none; | ||
user-select: none; | ||
text-decoration: none; | ||
text-align: center; | ||
padding: 5px 8px; | ||
font-size: 14px; | ||
color: var(--vscode-sideBarTitle-foreground); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is already defined. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok removed except for padding which is needed |
||
} | ||
|
||
.toolbar-button:disabled { | ||
|
@@ -39,3 +49,7 @@ | |
.toolbar-button:not(:disabled):active { | ||
background-color: var(--vscode-toolbar-activeBackground); | ||
} | ||
|
||
.toolbar-button > :not(:last-child) { | ||
margin-right: 8px; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ export interface ToolbarButtonProps { | |
icon: string, | ||
disabled?: boolean, | ||
toggled?: boolean, | ||
type?: 'button' | 'submit' | 'reset', | ||
onClick: () => void, | ||
} | ||
|
||
|
@@ -32,10 +33,11 @@ export const ToolbarButton: React.FC<React.PropsWithChildren<ToolbarButtonProps> | |
icon = '', | ||
disabled = false, | ||
toggled = false, | ||
type = 'button', | ||
onClick = () => {}, | ||
}) => { | ||
let className = `toolbar-button ${icon}`; | ||
if (toggled) | ||
className += ' toggled'; | ||
return <button className={className} onClick={onClick} title={title} disabled={!!disabled}><span className={`codicon codicon-${icon}`}></span>{ children }</button>; | ||
return <button className={className} type={type} onClick={onClick} title={title} disabled={!!disabled}><span className={`codicon codicon-${icon}`}></span>{ children }</button>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can toolbar button be a submit / reset? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you're right |
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you aligning the visual language with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using the border radius of 6px as same as githubs buttons