Gitako/src/content.less
2018-05-06 21:22:35 +08:00

273 lines
5.5 KiB
Text

@name: gitako;
@side-bar-width: 260px;
@github-content-width: 1280px;
@content-width: (@side-bar-width + @github-content-width);
.with-@{name}-spacing {
margin-left: @side-bar-width;
@media (min-width: @github-content-width) and (max-width: @content-width) {
margin-left: ~'calc(' @content-width ~' - 100vw)';
}
@media (min-width: @content-width) {
margin-left: 0;
}
}
.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("./assets/icons/octicons/clippy.svg?inline");
background-position: center;
background-repeat: no-repeat;
}
&.success {
.icon {
background-image: url("./assets/icons/octicons/check.svg?inline");
}
}
&.fail {
.icon {
background-image: url("./assets/icons/octicons/x.svg?inline");
}
}
}
}
}
.hidden {
display: none;
}
.invisible {
visibility: hidden;
}
.@{name}-logo-wrapper {
margin-right: 12px;
padding-right: 12px;
border-right: 1px solid #ffffffbf;
height: 100%;
line-height: 1;
display: inline-flex;
align-items: center;
cursor: pointer;
.action-icon {
width: 12px;
height: 24px;
margin-right: 8px;
}
.@{name}-logo {
font-family: monospace;
vertical-align: middle;
cursor: pointer;
-webkit-font-smoothing: antialiased;
}
}
.@{name} {
.@{name}-side-bar {
position: fixed;
top: 0;
left: 0;
display: flex;
flex-direction: column;
width: @side-bar-width;
height: 100vh;
z-index: 2;
background: #fafbfc;
border-right: 1px solid #e1e4e8;
overflow: hidden;
@media screen and (min-width: @content-width) {
border-left: 1px solid #e1e4e8;
left: ~'calc((100vw - ' @content-width ~') / 2)';
}
&.hidden {
.hidden;
}
.octicon {
transition: 0.3s ease;
color: rgba(3, 47, 98, 0.55);
vertical-align: initial;
}
.octicon-wrapper {
display: inline-block;
width: 16px;
height: 16px;
text-align: center;
vertical-align: middle;
}
.octicon-color {
color: rgba(3, 47, 98, 0.55);
}
.@{name}-side-bar-content {
display: flex;
flex: 1;
flex-direction: column;
.meta-bar {
position: relative;
padding: 10px;
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;
}
.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);
pointer-events: none;
}
/* search input */
.search-input-wrapper {
input[type='text'].form-control {
box-shadow: none;
width: 100%;
}
}
.no-results {
padding: 0px 10px;
color: #666;
}
.files {
flex: 1;
overflow: auto;
}
.node-item-row {
background: #fff;
&:hover {
background: #f6f8fa;
}
&.focused {
background: #f0f0f6;
}
.node-item {
word-wrap: normal;
word-break: break-all;
margin: 0;
color: #0366d6;
line-height: 20px;
padding: 6px 0;
cursor: pointer;
border-top: 1px solid #eaecef;
transition: all 0.5s ease;
// folder icon rotate when expand
&.expanded .octicon.octicon-triangle-right {
transform: rotate(90deg);
}
.node-item-name {
padding-left: 6px;
vertical-align: middle;
}
.node-item:hover .node-item-name {
text-decoration: underline;
}
}
}
}
}
.@{name}-settings-bar {
border-top: 1px solid #eaecef;
box-shadow: 0px -2px 16px #666666dd;
&-content {
padding: 0 10px;
&-section {
padding-bottom: 10px;
}
}
.access-token {
border-bottom: none; // prevent overwrite by github style
}
.access-token-input {
width: 100%;
margin-top: 4px;
box-shadow: none;
}
.placeholder-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 6px 10px;
.settings-icon {
width: 20px;
height: 20px;
cursor: pointer;
}
}
}
}
}
@keyframes rainbow {
0% {
background-position: 9% 91%;
}
50% {
background-position: 91% 9%;
}
100% {
background-position: 9% 91%;
}
}