-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Dark mode cleanup #31208
Dark mode cleanup #31208
Changes from 7 commits
c4f2d40
4dc23f1
74b7bdf
a91fd21
e8e9331
7833182
28671ef
f6794b2
f7e7c6b
7f7eddd
167e2c3
53f00dd
ff9576c
32ef59d
49279cc
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
*/ | ||
import React from 'react'; | ||
|
||
import { EuiIcon, EuiSideNav } from '@elastic/eui'; | ||
import { EuiIcon, EuiSideNav, EuiText } from '@elastic/eui'; | ||
import classes from 'classnames'; | ||
|
||
import theme from '@elastic/eui/dist/eui_theme_light.json'; | ||
|
@@ -16,7 +16,6 @@ import { FileTree as Tree, FileTreeItemType } from '../../../model'; | |
import { closeTreePath, fetchRepoTree, FetchRepoTreePayload } from '../../actions'; | ||
import { EuiSideNavItem, MainRouteParams, PathTypes } from '../../common/types'; | ||
import { RootState } from '../../reducers'; | ||
import { FolderClosedTriangle, FolderOpenTriangle } from '../shared'; | ||
|
||
const DirectoryNode = styled.span` | ||
margin-left: ${theme.euiSizeXs}; | ||
|
@@ -93,12 +92,28 @@ export class CodeFileTree extends React.Component<Props> { | |
onClick={onClick} | ||
> | ||
{forceOpen ? ( | ||
<FolderOpenTriangle onClick={onFolderClick} /> | ||
<EuiIcon | ||
type="arrowDown" | ||
size="s" | ||
color="subdued" | ||
style={{ marginRight: '.5rem' }} | ||
onClick={onFolderClick} | ||
/> | ||
) : ( | ||
<FolderClosedTriangle onClick={onFolderClick} /> | ||
<EuiIcon | ||
type="arrowRight" | ||
size="s" | ||
color="subdued" | ||
style={{ marginRight: '.5rem' }} | ||
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. Try not to use inline styles. |
||
onClick={onFolderClick} | ||
/> | ||
)} | ||
<EuiIcon type={forceOpen ? 'folderOpen' : 'folderClosed'} /> | ||
<DirectoryNode>{`${node.name}/`}</DirectoryNode> | ||
<EuiIcon type={forceOpen ? 'folderOpen' : 'folderClosed'} color="subdued" /> | ||
<DirectoryNode> | ||
<EuiText size="s" grow={false} style={{ display: 'inline-block' }}> | ||
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. Same here. There is an eui utility class for this. https://elastic.github.io/eui/#/utilities/css-utility-classes |
||
{`${node.name}/`} | ||
</EuiText> | ||
</DirectoryNode> | ||
</div> | ||
); | ||
} | ||
|
@@ -110,8 +125,12 @@ export class CodeFileTree extends React.Component<Props> { | |
className={classes(className, 'code-file-tree-file')} | ||
role="button" | ||
> | ||
<EuiIcon type="submodule" /> | ||
<DirectoryNode>{node.name}</DirectoryNode> | ||
<EuiIcon type="submodule" color="subdued" /> | ||
<DirectoryNode> | ||
<EuiText size="s" grow={false} style={{ display: 'inline-block' }}> | ||
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. Same |
||
{node.name} | ||
</EuiText> | ||
</DirectoryNode> | ||
</div> | ||
); | ||
} | ||
|
@@ -123,8 +142,12 @@ export class CodeFileTree extends React.Component<Props> { | |
className={classes(className, 'code-file-tree-file')} | ||
role="button" | ||
> | ||
<EuiIcon type="symlink" /> | ||
<DirectoryNode>{node.name}</DirectoryNode> | ||
<EuiIcon type="symlink" color="subdued" /> | ||
<DirectoryNode> | ||
<EuiText size="s" grow={false} style={{ display: 'inline-block' }}> | ||
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. Same |
||
{node.name} | ||
</EuiText> | ||
</DirectoryNode> | ||
</div> | ||
); | ||
} | ||
|
@@ -136,8 +159,12 @@ export class CodeFileTree extends React.Component<Props> { | |
className={classes(className, 'code-file-tree-file')} | ||
role="button" | ||
> | ||
<EuiIcon type="document" /> | ||
<DirectoryNode>{node.name}</DirectoryNode> | ||
<EuiIcon type="document" color="subdued" /> | ||
<DirectoryNode> | ||
<EuiText size="s" grow={false} style={{ display: 'inline-block' }}> | ||
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. Same |
||
{node.name} | ||
</EuiText> | ||
</DirectoryNode> | ||
</div> | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,106 @@ | |
.code-auto-margin { | ||
margin: auto; | ||
} | ||
|
||
.code-navigation__sidebar { | ||
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. I'd try to follow the naming conventions of the rest of Kibana / EUI. This going for everything in this page.
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. I like that better. I was becoming overwhelmed by hyphens. :) 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. Yep, there's some docs at the bottom of the sass guidelines but generally the following is the formula.
|
||
width: calc(256rem / 14); | ||
border-right: $euiBorderThin; | ||
display: flex; | ||
flex-direction: column; | ||
& > div { | ||
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. Try to avoid generic selectors. Use classes. |
||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
& > div:first-child { | ||
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. Same here. |
||
flex-shrink: 0; | ||
flex-grow: 0; | ||
} | ||
& > div:not(:first-child) { | ||
display: flex; | ||
flex-direction: column; | ||
flex-grow: 1; | ||
flex-shrink: 1; | ||
} | ||
} | ||
} | ||
|
||
.code-file-tree__container { | ||
flex-grow: 1; | ||
flex-shrink: 1; | ||
overflow: auto; | ||
padding: $euiSizeM; | ||
background-color: $euiColorLightestShade; | ||
} | ||
|
||
.code-directory__node { | ||
width: calc(200rem / 14); | ||
margin: 0 $euiSizeXS $euiSizeS; | ||
padding: $euiSizeXS; | ||
border-radius: $euiBorderRadius; | ||
a { | ||
color: $euiColorDarkestShade; | ||
} | ||
&:hover { | ||
background-color: rgba($euiColorGhost, .10); | ||
cursor: pointer; | ||
} | ||
} | ||
.code-timeline { | ||
border-left: $euiBorderThick; | ||
margin-left: $euiSizeXS; | ||
padding: $euiSizeS 0 $euiSizeS $euiSizeS; | ||
} | ||
|
||
.code-timeline__marker { | ||
width: $euiSizeS; | ||
height: $euiSizeS; | ||
border-radius: $euiSizeS / 2; | ||
background-color: $euiBorderColor; | ||
margin: auto; | ||
} | ||
|
||
.code-timeline__commit-container { | ||
margin: 0 0 $euiSizeXS $euiSizeM; | ||
.euiPanel:not(:first-of-type), .euiPanel:not(:last-of-type) { | ||
border-radius: 0; | ||
} | ||
} | ||
|
||
.euiPanel.code-timeline__commit--root { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
&:not(:first-child) { | ||
border-top: none; | ||
} | ||
&:not(:first-child):not(:last-child) { | ||
border-radius: 0; | ||
} | ||
&:first-child { | ||
border-radius: $euiSizeXS $euiSizeXS 0 0; | ||
} | ||
&:last-child { | ||
border-radius: 0 0 $euiSizeXS $euiSizeXS; | ||
} | ||
&:only-child{ | ||
border-radius: $euiSizeXS | ||
} | ||
} | ||
|
||
.code-top-bar__container { | ||
box-sizing: content-box; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
padding: $euiSizeS; | ||
min-height: 80px; | ||
border-bottom: $euiBorderThin; | ||
nav { | ||
a { | ||
display: inline; | ||
} | ||
div { | ||
vertical-align: baseline; | ||
} | ||
} | ||
} |
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.
revert this file, here we delete one more line break
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.
@zfy0701 I think we're good here now.