Skip to content

Commit b89a7b3

Browse files
committed
add --char-width and --char-height CSS variables
1 parent 473e835 commit b89a7b3

8 files changed

+37
-9
lines changed

css/jquery.terminal-src.css

+5
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,11 @@ terminal .terminal-output > div {
989989
inherits: true;
990990
initial-value: auto;
991991
}
992+
@property --cols {
993+
syntax: '<number> | auto';
994+
inherits: true;
995+
initial-value: auto;
996+
}
992997
@supports (-ms-ime-align:auto) {
993998
.terminal h1::selection,
994999
.terminal h2::selection,

css/jquery.terminal.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Copyright (c) 2011-2024 Jakub T. Jankiewicz <https://jcubic.pl/me>
1313
* Released under the MIT license
1414
*
15-
* Date: Sun, 17 Nov 2024 13:13:41 +0000
15+
* Date: Mon, 18 Nov 2024 22:45:17 +0000
1616
*/
1717
.terminal .terminal-output .format, .cmd .format,
1818
.cmd-prompt, .cmd-prompt div {
@@ -989,6 +989,11 @@ terminal .terminal-output > div {
989989
inherits: true;
990990
initial-value: auto;
991991
}
992+
@property --cols {
993+
syntax: '<number> | auto';
994+
inherits: true;
995+
initial-value: auto;
996+
}
992997
@supports (-ms-ime-align:auto) {
993998
.terminal h1::selection,
994999
.terminal h2::selection,

css/jquery.terminal.min.css

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/jquery.terminal.min.css.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal-src.js

+9
Original file line numberDiff line numberDiff line change
@@ -12580,9 +12580,18 @@
1258012580
});
1258112581
function calculate_char_size() {
1258212582
var width = char_size.width;
12583+
var height = char_size.height;
1258312584
char_size = get_char_size(self);
12585+
var css_vars = {};
1258412586
if (width !== char_size.width) {
1258512587
command_line.option('charWidth', char_size.width).refresh();
12588+
css_vars['char-width'] = char_size.width;
12589+
}
12590+
if (height !== char_size.height) {
12591+
css_vars['char-height'] = char_size.height;
12592+
}
12593+
if (Object.keys(css_vars).length) {
12594+
css(self[0], css_vars);
1258612595
}
1258712596
}
1258812597
resize();

js/jquery.terminal.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
*
4242
* broken image by Sophia Bai from the Noun Project (CC-BY)
4343
*
44-
* Date: Sun, 17 Nov 2024 13:32:31 +0000
44+
* Date: Mon, 18 Nov 2024 22:45:16 +0000
4545
*/
4646
/* global define, Map, BigInt */
4747
/* eslint-disable */
@@ -5345,7 +5345,7 @@
53455345
// -------------------------------------------------------------------------
53465346
$.terminal = {
53475347
version: 'DEV',
5348-
date: 'Sun, 17 Nov 2024 13:32:31 +0000',
5348+
date: 'Mon, 18 Nov 2024 22:45:16 +0000',
53495349
// colors from https://www.w3.org/wiki/CSS/Properties/color/keywords
53505350
color_names: [
53515351
'transparent', 'currentcolor', 'black', 'silver', 'gray', 'white',
@@ -12580,9 +12580,18 @@
1258012580
});
1258112581
function calculate_char_size() {
1258212582
var width = char_size.width;
12583+
var height = char_size.height;
1258312584
char_size = get_char_size(self);
12585+
var css_vars = {};
1258412586
if (width !== char_size.width) {
1258512587
command_line.option('charWidth', char_size.width).refresh();
12588+
css_vars['char-width'] = char_size.width;
12589+
}
12590+
if (height !== char_size.height) {
12591+
css_vars['char-height'] = char_size.height;
12592+
}
12593+
if (Object.keys(css_vars).length) {
12594+
css(self[0], css_vars);
1258612595
}
1258712596
}
1258812597
resize();

js/jquery.terminal.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.terminal.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)