Skip to content

Commit

Permalink
Modularize CSS files
Browse files Browse the repository at this point in the history
Replace our copy of `xterm.css` with an import.

Signed-off-by: William So <polyipseity@gmail.com>
  • Loading branch information
polyipseity committed Apr 29, 2023
1 parent d1f5b89 commit 2671e17
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 236 deletions.
4 changes: 4 additions & 0 deletions sources/icons.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
svg.svg-icon[class*=terminal\:] {
fill: none;
stroke: currentColor;
}
3 changes: 3 additions & 0 deletions sources/status-bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.terminal\:hide-status-bar {
display: none;
}
241 changes: 5 additions & 236 deletions sources/styles.css
Original file line number Diff line number Diff line change
@@ -1,236 +1,5 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/term.js
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Originally forked from (with the author's permission):
* Fabrice Bellard's javascript vt100 for jslinux:
* http://bellard.org/jslinux/
* Copyright (c) 2011 Fabrice Bellard
* The original design remains. The terminal itself
* has been extended to include xterm CSI codes, among
* other features.
*/

/**
* Default styles for xterm.js
*/

.terminal\:terminal .xterm {
cursor: text;
position: relative;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}

.terminal\:terminal .xterm.focus,
.terminal\:terminal .xterm:focus {
outline: none;
}

.terminal\:terminal .xterm .xterm-helpers {
position: absolute;
top: 0;
/**
* The z-index of the helpers must be higher than the canvases in order for
* IMEs to appear on top.
*/
z-index: 5;
}

.terminal\:terminal .xterm .xterm-helper-textarea {
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -5;
/** Prevent wrapping so the IME appears against the textarea at the correct position */
white-space: nowrap;
overflow: hidden;
resize: none;
}

.terminal\:terminal .xterm .composition-view {
/* TODO: Composition position got messed up somewhere */
background: #000;
color: #FFF;
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
}

.terminal\:terminal .xterm .composition-view.active {
display: block;
}

.terminal\:terminal .xterm .xterm-viewport {
/* On OS X this is required in order for the scroll bar to appear fully opaque */
background-color: #000;
overflow-y: scroll;
cursor: default;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
}

.terminal\:terminal .xterm .xterm-screen {
position: relative;
}

.terminal\:terminal .xterm .xterm-screen canvas {
position: absolute;
left: 0;
top: 0;
}

.terminal\:terminal .xterm .xterm-scroll-area {
visibility: hidden;
}

.terminal\:terminal .xterm-char-measure-element {
display: inline-block;
visibility: hidden;
position: absolute;
top: 0;
left: -9999em;
line-height: normal;
}

.terminal\:terminal .xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default;
}

.terminal\:terminal .xterm.xterm-cursor-pointer,
.terminal\:terminal .xterm .xterm-cursor-pointer {
cursor: pointer;
}

.terminal\:terminal .xterm.column-select.focus {
/* Column selection mode */
cursor: crosshair;
}

.terminal\:terminal .xterm .xterm-accessibility,
.terminal\:terminal .xterm .xterm-message {
position: absolute;
left: 0;
top: 0;
bottom: 0;
z-index: 10;
color: transparent;
}

.terminal\:terminal .xterm .live-region {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
}

.terminal\:terminal .xterm-dim {
opacity: 0.5;
}

.terminal\:terminal .xterm-underline-1 {
text-decoration: underline;
}

.terminal\:terminal .xterm-underline-2 {
text-decoration: double underline;
}

.terminal\:terminal .xterm-underline-3 {
text-decoration: wavy underline;
}

.terminal\:terminal .xterm-underline-4 {
text-decoration: dotted underline;
}

.terminal\:terminal .xterm-underline-5 {
text-decoration: dashed underline;
}

.terminal\:terminal .xterm-strikethrough {
text-decoration: line-through;
}

.terminal\:terminal .xterm-screen .xterm-decoration-container .xterm-decoration {
z-index: 6;
position: absolute;
}

.terminal\:terminal .xterm-decoration-overview-ruler {
z-index: 7;
position: absolute;
top: 0;
right: 0;
pointer-events: none;
}

.terminal\:terminal .xterm-decoration-top {
z-index: 2;
position: relative;
}

/* end of xterm styles */

.terminal\:await-css {
display: unset !important;
}

.workspace-leaf-content[data-type=terminal\:terminal] .view-content {
overflow: clip;
display: flex;
flex-direction: column;
}

.is-phone .workspace-leaf-content[data-type=terminal\:terminal] .view-content {
padding-bottom: max(var(--size-4-4), calc(var(--icon-l) + var(--size-4-2) + max(var(--size-4-2), var(--safe-area-inset-bottom))));
}

.terminal\:terminal {
flex: 1;
min-width: 0;
min-height: 0;
}

svg.svg-icon[class*=terminal\:] {
fill: none;
stroke: currentColor;
}

.terminal\:hide-status-bar {
display: none;
}
@import "./icons.css";
@import "./status-bar.css";
@import "./terminal/emulator.css";
@import "./terminal/view.css";
@import "./utils/obsidian.css";
1 change: 1 addition & 0 deletions sources/terminal/emulator.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "xterm/css/xterm.css";
15 changes: 15 additions & 0 deletions sources/terminal/view.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.workspace-leaf-content[data-type=terminal\:terminal] .view-content {
overflow: clip;
display: flex;
flex-direction: column;
}

.terminal\:terminal {
flex: 1;
min-width: 0;
min-height: 0;
}

.is-phone .workspace-leaf-content[data-type=terminal\:terminal] .view-content {
padding-bottom: max(var(--size-4-4), calc(var(--icon-l) + var(--size-4-2) + max(var(--size-4-2), var(--safe-area-inset-bottom))));
}
3 changes: 3 additions & 0 deletions sources/utils/obsidian.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.terminal\:await-css {
display: unset !important;
}

0 comments on commit 2671e17

Please sign in to comment.