Skip to content

Commit 463bd5f

Browse files
Merge pull request #3 from CodeSignal/styles-polishing
Styles polishing
2 parents b0f5d2f + 77d6ef1 commit 463bd5f

File tree

4 files changed

+49
-25
lines changed

4 files changed

+49
-25
lines changed

diagram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function renderTable(svg, table, schema, selectedTableId, selectedColId, onSelec
9999
title.textContent = table.name; g.appendChild(title);
100100

101101
// HEADER SEPARATOR
102-
g.appendChild(createSvg('line', { x1: x, y1: y + DIAGRAM.HEADER_H, x2: x + width, y2: y + DIAGRAM.HEADER_H, stroke: '#e4e4e8' }));
102+
g.appendChild(createSvg('line', { x1: x + 8, y1: y + DIAGRAM.HEADER_H, x2: x + width - 8, y2: y + DIAGRAM.HEADER_H, stroke: '#d1d5db', 'stroke-width': '0.5' }));
103103

104104
// DRAG BUTTON (the ONLY drag handle)
105105
const btnSize = 16;

server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# server.py (only the imports and do_POST change shown)
22
from http.server import SimpleHTTPRequestHandler
33
from socketserver import TCPServer
4-
from urllib.parse import urlparse, parse_qs # ← add
4+
from urllib.parse import urlparse, parse_qs
55
import json
66
import os
77

88
PORT = 3000
9-
ALLOWED_FILES = {"test.json", "solution.json"} # ← add
9+
ALLOWED_FILES = {"test.json", "solution.json"}
1010

1111
class Handler(SimpleHTTPRequestHandler):
1212
def log_message(self, format, *args):

solution.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@
7777
"uniqueConstraints": [],
7878
"indexes": [],
7979
"position": {
80-
"x": 234,
81-
"y": 109
82-
}
80+
"x": 85,
81+
"y": -102
82+
},
83+
"color": "blue"
8384
}
8485
],
8586
"foreignKeys": [

style.css

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
/* Put these with your other :root vars */
55
:root {
66
/* header fills (light) */
7-
--tbl-white: #ffffff;
8-
--tbl-blue: #8eb3f0;
9-
--tbl-green: #bbe5d1;
10-
--tbl-red: #f8caca;
7+
--tbl-white: #f4f6f8;
8+
--tbl-blue: #8bd0f9;
9+
--tbl-green: #b0f1a9;
10+
--tbl-red: #ff8595;
1111
}
1212

1313
@media (prefers-color-scheme: dark) {
1414
:root {
1515
/* darker tints that read well with white text */
1616
--tbl-white: #4a5a7b; /* slate-ish */
17-
--tbl-blue: #0c2658; /* deep blue */
18-
--tbl-green: #07402d; /* deep green */
19-
--tbl-red: #5d1d1d; /* deep red */
17+
--tbl-blue: #5252b7; /* iris */
18+
--tbl-green: #419f65; /* shamrock green */
19+
--tbl-red: #df5353; /* deep red */
2020
}
2121
}
2222

@@ -71,21 +71,21 @@
7171
}
7272

7373
header{
74-
display:flex;align-items:baseline;gap:1rem;padding:.75rem 1rem;
74+
display:flex;align-items:center;gap:1rem;padding:.5rem 1rem; /* Reduced from .75rem to .5rem */
7575
border-bottom:1px solid var(--stroke);
7676
background:var(--box)
7777
}
7878

7979
/* Light theme navigation bar background */
8080
@media (prefers-color-scheme: light) {
8181
header {
82-
background: rgb(238, 239, 246);
82+
background: #ffffff; /* Changed to white */
8383
}
8484
}
8585
header h1{font-size:1.1rem;margin:0}
8686
#status{font-size:.9rem;color:var(--muted)}
8787

88-
main.layout{display:grid;grid-template-columns:300px 1fr;height:calc(100% - 50px)}
88+
main.layout{display:grid;grid-template-columns:300px 1fr;height:calc(100% - 42px)} /* Adjusted for smaller header */
8989
#diagram-wrap{width:100%;height:100%}
9090

9191
#diagram{ background: var(--canvas); }
@@ -142,22 +142,34 @@
142142

143143
/* Input field specific styles (exclude checkboxes) */
144144
input:not([type="checkbox"]) {
145-
min-height: 3.75rem;
145+
min-height: 3rem; /* Reduced from 3.75rem (20% reduction) */
146146
max-height: 8.737499999999999rem;
147147
padding-left: 1rem;
148148
padding-right: 2.75rem;
149-
padding-top: 0.94975rem;
150-
padding-bottom: 0.94975rem;
149+
padding-top: 0.75rem; /* Reduced from 0.94975rem */
150+
padding-bottom: 0.75rem; /* Reduced from 0.94975rem */
151151
}
152152

153153
/* Select field specific styles to match inputs */
154154
select {
155-
min-height: 3.75rem;
155+
-webkit-appearance: none;
156+
-moz-appearance: none;
157+
min-height: 3rem; /* Reduced from 3.75rem (20% reduction) */
156158
max-height: 8.737499999999999rem;
157159
padding-left: 1rem;
158-
padding-right: 2.75rem;
159-
padding-top: 0.94975rem;
160-
padding-bottom: 0.94975rem;
160+
padding-right: 3rem; /* Increased from 2.75rem to give arrow more space */
161+
padding-top: 0.75rem; /* Reduced from 0.94975rem */
162+
padding-bottom: 0.75rem; /* Reduced from 0.94975rem */
163+
appearance: none; /* Remove default arrow */
164+
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
165+
background-repeat: no-repeat;
166+
background-position: right 0.75rem center; /* Position arrow with proper spacing */
167+
background-size: 1rem;
168+
}
169+
170+
/* Hide IE/Edge dropdown arrow */
171+
select::-ms-expand {
172+
display: none;
161173
}
162174

163175
input:not([type="checkbox"]):hover, select:hover {
@@ -227,6 +239,16 @@
227239
border-color: transparent;
228240
}
229241

242+
/* Dark mode dropdown arrow */
243+
select {
244+
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c1c7d7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
245+
background-repeat: no-repeat;
246+
background-position: right 0.75rem center;
247+
background-size: 1rem;
248+
padding-left: 1rem; /* Ensure left padding is maintained in dark mode */
249+
padding-right: 3rem; /* Ensure right padding is maintained in dark mode */
250+
}
251+
230252
input:not([type="checkbox"]):hover, select:hover {
231253
border-color: #26314c;
232254
}
@@ -307,10 +329,11 @@
307329

308330
/* --- help button alignment --- */
309331
.spacer { flex: 1; }
310-
#btn-help { margin-left: auto; }
332+
#btn-help { margin-left: auto; margin-top: 0; }
311333

312334
.as-button {
313-
display: inline-block;
335+
display: inline-flex;
336+
align-items: center;
314337
padding: .5rem .75rem;
315338
border: 1px solid #e2e8f0;
316339
border-radius: .5rem;

0 commit comments

Comments
 (0)