Skip to content

Commit d04814e

Browse files
committed
Sass: replace compass/css3 functions with dart-sass built-in
Signed-off-by: Jack Cherng <[email protected]>
1 parent a3b05d9 commit d04814e

File tree

2 files changed

+48
-34
lines changed

2 files changed

+48
-34
lines changed

example/diff-table.css

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
/**
2-
* compiled by https://www.sassmeister.com with
2+
* You can compile this by https://www.sassmeister.com with
33
*
4-
* - Sass v3.4.25
4+
* - dart-sass v1.18.0
55
*/
66
.diff {
7+
background-color: #fff;
78
border-collapse: collapse;
89
border-spacing: 0;
9-
border: 1px solid #000;
10-
color: #000;
10+
border: 1px solid black;
11+
color: black;
1112
empty-cells: show;
1213
font-family: monospace;
1314
font-size: 13px;
@@ -31,21 +32,21 @@
3132
pointer-events: none;
3233
}
3334
.diff thead th {
34-
background: #aaa;
35-
border-bottom: 1px solid #000;
35+
background: #a6a6a6;
36+
border-bottom: 1px solid black;
3637
padding: 4px;
3738
text-align: left;
3839
}
3940
.diff tbody.skipped {
40-
border-top: 1px solid #000;
41+
border-top: 1px solid black;
4142
}
4243
.diff tbody.skipped td,
4344
.diff tbody.skipped th {
4445
display: none;
4546
}
4647
.diff tbody th {
47-
background: #ccc;
48-
border-right: 1px solid #000;
48+
background: #cccccc;
49+
border-right: 1px solid black;
4950
text-align: right;
5051
vertical-align: top;
5152
width: 4em;
@@ -82,10 +83,10 @@
8283
text-decoration: none;
8384
}
8485
.diff.diff-html .change ins {
85-
background: #8e8;
86+
background: #a0f1a0;
8687
}
8788
.diff.diff-html .change del {
88-
background: #e88;
89+
background: #f1a0a0;
8990
}
9091
.diff.diff-html .edit-container:hover {
9192
box-shadow: 0 0 8px 2px #888;

example/diff-table.scss

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
1-
@import "compass/css3";
1+
/**
2+
* You can compile this by https://www.sassmeister.com with
3+
*
4+
* - dart-sass v1.18.0
5+
*/
26

37
.diff {
4-
$bgcolor: #fff;
5-
$bgcolor-edit-highlight: #88e;
6-
$bgcolor-insert-highlight: #8e8;
7-
$bgcolor-delete-highlight: #e88;
8+
$bg-color: #fff;
9+
$text-color: invert($bg-color);
810

9-
$bgcolor-edit: tint($bgcolor-edit-highlight, 75%);
10-
$bgcolor-insert: tint($bgcolor-insert-highlight, 75%);
11-
$bgcolor-delete: tint($bgcolor-delete-highlight, 75%);
11+
$bg-color-edit-base: #88e;
12+
$bg-color-insert-base: #8e8;
13+
$bg-color-delete-base: #e88;
1214

13-
$table-head-color: #aaa;
14-
$table-sidebar-color: #ccc;
15-
$border-color: #000;
15+
// emphasized colors for detailed inline difference
16+
$bg-color-edit-highlight: mix($bg-color-edit-base, $bg-color, 80%);
17+
$bg-color-insert-highlight: mix($bg-color-insert-base, $bg-color, 80%);
18+
$bg-color-delete-highlight: mix($bg-color-delete-base, $bg-color, 80%);
1619

20+
// colors for operation rows
21+
$bg-color-edit: mix($bg-color-edit-base, $bg-color, 25%);
22+
$bg-color-insert: mix($bg-color-insert-base, $bg-color, 25%);
23+
$bg-color-delete: mix($bg-color-delete-base, $bg-color, 25%);
24+
25+
$table-head-color: mix($bg-color, $text-color, 65%);
26+
$table-sidebar-color: mix($bg-color, $text-color, 80%);
27+
$border-color: $text-color;
28+
29+
background-color: $bg-color;
1730
border-collapse: collapse;
1831
border-spacing: 0;
1932
border: 1px solid $border-color;
20-
color: #000;
33+
color: $text-color;
2134
empty-cells: show;
2235
font-family: monospace;
2336
font-size: 13px;
@@ -33,7 +46,7 @@
3346
border-collapse: separate;
3447
border: none;
3548
padding: 1px 2px;
36-
background: $bgcolor;
49+
background: $bg-color;
3750

3851
a {
3952
color: #000;
@@ -51,7 +64,7 @@
5164

5265
tbody {
5366
&.skipped {
54-
border-top: 1px solid #000;
67+
border-top: 1px solid $border-color;
5568

5669
td,
5770
th {
@@ -67,18 +80,18 @@
6780
width: 4em;
6881

6982
&.sign {
70-
background: $bgcolor;
83+
background: $bg-color;
7184
border-right: none;
7285
padding: 1px 0;
7386
text-align: center;
7487
width: 1em;
7588

7689
&.del {
77-
background: $bgcolor-delete;
90+
background: $bg-color-delete;
7891
}
7992

8093
&.ins {
81-
background: $bgcolor-insert;
94+
background: $bg-color-insert;
8295
}
8396
}
8497
}
@@ -91,16 +104,16 @@
91104
&.change-eq {
92105
.old,
93106
.new {
94-
background: $bgcolor;
107+
background: $bg-color;
95108
}
96109
}
97110

98111
.old {
99-
background: $bgcolor-delete;
112+
background: $bg-color-delete;
100113
}
101114

102115
.new {
103-
background: $bgcolor-insert;
116+
background: $bg-color-insert;
104117
}
105118

106119
ins,
@@ -110,11 +123,11 @@
110123
}
111124

112125
ins {
113-
background: $bgcolor-insert-highlight;
126+
background: $bg-color-insert-highlight;
114127
}
115128

116129
del {
117-
background: $bgcolor-delete-highlight;
130+
background: $bg-color-delete-highlight;
118131
}
119132
}
120133

@@ -126,7 +139,7 @@
126139
}
127140

128141
&.edited {
129-
background: $bgcolor-edit;
142+
background: $bg-color-edit;
130143
}
131144
}
132145

0 commit comments

Comments
 (0)