Gitako/src/content.less
2020-03-10 22:03:54 +08:00

552 lines
11 KiB
Text

@import '~nprogress/nprogress.css';
@name: gitako;
@min-screen-width: 1280px;
@github-content-width: 1020px;
@side-bar-base-width: (@min-screen-width - @github-content-width);
@min-width-with-gitako: (@min-screen-width + @side-bar-base-width);
@github-header-z-index: 32;
@github-pull-request-float-header-z-index: 110;
@minimal-z-index: max(@github-header-z-index, @github-pull-request-float-header-z-index) + 1;
:root {
--gitako-width: @side-bar-base-width;
}
.@{name}-ready {
.js-header-wrapper {
background: #24292e;
}
.Header {
max-width: 1012px;
margin: 0 auto;
}
}
@media (min-width: @github-content-width) {
body {
min-width: @github-content-width;
}
}
.markdown-body {
.clippy-wrapper {
position: relative;
width: 0;
height: 0;
top: 8px;
left: ~'calc(100% - 40px)';
z-index: 1;
.clippy {
width: 32px;
height: 32px;
border: 1px solid #ddd;
border-radius: 4px;
background: #f9f9f9;
&:hover {
background: #fff;
}
&:active {
background: #f0f0f0;
}
.icon {
width: 100%;
height: 100%;
display: block;
background-image: url('~@primer/octicons/build/svg/clippy.svg?inline');
background-position: center;
background-repeat: no-repeat;
&.success {
background-image: url('~@primer/octicons/build/svg/check.svg?inline');
}
&.fail {
background-image: url('~@primer/octicons/build/svg/x.svg?inline');
}
}
}
}
}
.progress-pjax-loader.is-loading {
left: 0; /* reposition progress bar of GitHub */
}
.hidden {
display: none;
}
.invisible {
visibility: hidden;
}
.@{name}-toggle-show-button-wrapper {
@animation-duration: 0.5s;
position: fixed;
top: 5px;
left: 0;
z-index: @minimal-z-index;
display: inline-flex;
justify-content: center;
align-items: center;
cursor: pointer;
padding: 4px;
will-change: transform;
border: 1px solid transparent;
.transform-expanded {
transform: translate(calc(var(--gitako-width) - 30px));
}
.transform-collapsed {
transform: translate(5px);
}
.transform-expanded;
animation: toggle-show-button-wrapper-expand @animation-duration;
&.collapsed {
border-color: #999999;
border-radius: 3px;
background: #f5f5f5;
.transform-collapsed;
animation: toggle-show-button-wrapper-collapse @animation-duration;
.action-icon {
color: #0366d6d0;
}
}
@keyframes toggle-show-button-wrapper-expand {
from {
.transform-collapsed;
}
to {
.transform-expanded;
}
}
@keyframes toggle-show-button-wrapper-collapse {
from {
.transform-expanded;
}
to {
.transform-collapsed;
}
}
.action-icon {
color: #666666;
width: 20px;
height: 20px;
text-align: center;
transition: all @animation-duration ease;
.octicon {
width: 100%;
height: 100%;
}
}
&.error {
.action-icon {
color: #d73a49;
}
}
.error-message {
display: none;
margin-left: 4px;
font-size: 12px;
}
&:hover {
.error-message {
display: inline;
}
}
}
.@{name}-side-bar {
.@{name}-position-wrapper {
position: fixed;
top: 0;
left: 0;
height: 100vh;
z-index: @minimal-z-index;
display: flex;
&.hidden {
.hidden;
}
.gitako-position-content {
width: var(--gitako-width);
}
}
.@{name}-resize-handler {
display: flex;
align-items: center;
cursor: ew-resize;
user-select: none;
width: 0;
background: #e1e4e8;
border-left: 1px solid #e1e4e8;
overflow: hidden;
&:hover {
width: 16px;
background: #fafbfc;
border-right: 1px solid #e1e4e8;
}
.octicon {
transform: rotate(90deg);
width: 14px;
height: 22px;
font-size: 0;
}
}
.@{name}-side-bar-body {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
background: #fafbfc;
border-right: 1px solid #e1e4e8;
border-left: 1px solid #e1e4e8;
overflow: hidden;
&.hidden {
.hidden;
}
.octicon {
transition: transform 0.3s ease;
color: rgba(3, 47, 98, 0.55);
width: 100%;
height: 100%;
}
.octicon-wrapper {
display: inline-block;
width: 16px;
height: 16px;
text-align: center;
}
.octicon-color {
color: rgba(3, 47, 98, 0.55);
}
.@{name}-side-bar-content {
display: flex;
flex: 1;
flex-direction: column;
max-height: calc(100vh - 34px); // temporary fix for layout issue occurred since Chrome v76
min-height: 0; // make content shrinkable
.meta-bar {
position: relative;
padding: 10px;
padding-right: 30px;
font-size: 13px;
line-height: 20px;
color: #586069;
background-color: #f1f8ff;
border-bottom: 1px solid #c8e1ff;
a {
// fix a weird bug:
// when gitako failed loading repo, cursor hovering <a> in meta bar will be 'text'
cursor: pointer;
}
.repo-name {
font-weight: bolder;
}
}
.description {
padding: 4px 10px;
}
.loading-indicator-container {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
.loading-indicator {
display: flex;
align-items: center;
&-icon {
width: 20px;
height: 20px;
.octicon {
width: 20px;
height: 20px;
animation: rotate 2s infinite linear;
}
}
}
}
.file-explorer {
width: 100%;
height: 100%;
outline: none;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
&.freeze {
filter: blur(1.5px) opacity(0.6) grayscale(0.9);
cursor: pointer;
> * {
pointer-events: none;
user-select: none;
}
}
/* search input */
.search-input-wrapper {
input.form-control {
width: 100%;
&.error {
border-color: #d73a49;
}
}
}
.no-results {
padding: 0px 10px;
color: #666;
}
.files {
flex: 1;
overflow: auto;
}
.node-item-row {
background: #fff;
&:hover {
background: #f6f8fa;
}
&.focused {
background: #f0f0f6;
}
&.disabled {
.node-item {
pointer-events: none;
color: #999999;
}
}
.node-item {
display: flex;
justify-content: space-between;
margin: 0;
color: #0366d6;
line-height: 20px;
padding: 6px 10px;
cursor: pointer;
border-top: 1px solid #eaecef;
transition: all 0.5s ease;
white-space: nowrap;
.icon-size() {
width: 16px;
height: 16px;
}
.octicon-wrapper:first-child {
margin-right: 6px;
}
&-type-icon {
margin-right: 4px;
.icon-size();
& + .octicon-wrapper,
& + .node-item-icon {
margin-right: 6px;
}
}
&-icon {
.icon-size();
object-fit: contain;
vertical-align: text-bottom;
box-sizing: content-box;
&.dim {
filter: sepia(1) hue-rotate(180deg);
}
}
// folder icon rotate when expand
&.expanded .octicon.ChevronRight {
transform: rotate(90deg);
}
.node-item-label {
overflow: hidden;
text-overflow: ellipsis;
}
&:hover .node-item-name {
text-decoration: underline;
}
.go-to-button {
display: none;
white-space: nowrap;
background: transparent;
border: none;
padding: 0;
}
&:hover {
.go-to-button {
display: inline-block;
}
}
}
}
}
}
.@{name}-settings-bar {
z-index: 2;
background: #fafbfc;
display: flex;
flex-direction: column;
max-height: 100%;
&-title {
border-top: 1px solid #eaecef;
padding: 6px 10px;
box-shadow: 0 1px 8px 0 rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14),
0 3px 3px -2px rgba(0, 0, 0, 0.12);
z-index: 1;
}
&-content {
padding: 10px 10px;
flex: 1;
overflow: auto;
position: relative;
.shadow-shelter {
position: absolute;
width: 100%;
height: 10px;
top: 0;
left: 0;
background: #fafbfc;
z-index: 1;
}
&-section {
&:not(:last-of-type) {
padding-bottom: 16px;
}
.description:hover {
cursor: help;
}
}
/* inputs for access token & shortcut were too wide */
input.form-control {
min-width: 100px;
}
.form-checkbox {
margin: 0;
}
}
select {
-moz-appearance: none;
}
.form-label {
margin-bottom: 2px;
display: inline-block;
}
.access-token {
border-bottom: none; // prevent overwrite by github style
.link-button {
cursor: pointer;
}
.hint {
color: #6a737d;
}
}
.access-token-input-control {
display: flex;
margin-top: 8px;
.access-token-input {
flex: 1;
&:disabled {
cursor: not-allowed;
}
}
}
.toggle-shortcut {
.hint {
color: #6a737d;
}
}
.toggle-shortcut-input-control {
display: flex;
.toggle-shortcut-input {
flex: 1;
}
}
.singleton {
.hint {
color: #6a737d;
}
}
.header-row {
flex-shrink: 0;
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 10px;
border-top: 1px solid #eaecef;
.version {
color: #999999;
}
.show-settings-icon {
width: 20px;
height: 20px;
cursor: pointer;
}
.hide-settings-icon {
width: 20px;
height: 20px;
cursor: pointer;
}
}
input.form-control:not(:last-child) {
margin-right: 5px;
}
}
}
}
@keyframes rotate {
from {
transform: rotateZ(0);
}
to {
transform: rotateZ(360deg);
}
}