sheets.css 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. /*
  2. ArozOS Office - Sheets stylesheet
  3. Grid chrome, cells, selection, sheet tabs, charts and print rules.
  4. Uses the shared office.css variables; dark mode via body.dark.
  5. */
  6. :root {
  7. --sh-headbg: var(--of-chrome-bg2);
  8. --sh-gridline: #dadce0;
  9. --sh-sel-bg: rgba(30, 158, 64, 0.10);
  10. --sh-frozen-shadow: rgba(60, 64, 67, 0.25);
  11. }
  12. body.dark {
  13. --sh-gridline: #43464b;
  14. --sh-sel-bg: rgba(76, 192, 106, 0.14);
  15. }
  16. /* ============ formula bar ============ */
  17. #shFxBar {
  18. display: flex;
  19. align-items: center;
  20. gap: 6px;
  21. padding: 3px 8px;
  22. background: var(--of-chrome-bg);
  23. border-bottom: 1px solid var(--of-border);
  24. flex: 0 0 auto;
  25. }
  26. #shNameBox {
  27. width: 90px;
  28. height: 26px;
  29. text-align: center;
  30. border: 1px solid var(--of-border);
  31. border-radius: 4px;
  32. background: var(--of-chrome-bg2);
  33. color: var(--of-fg);
  34. font-size: 13px;
  35. outline: none;
  36. }
  37. #shNameBox:focus { border-color: var(--of-accent); }
  38. #shFxLabel {
  39. color: var(--of-fg-soft);
  40. font-style: italic;
  41. font-family: Georgia, serif;
  42. font-size: 14px;
  43. user-select: none;
  44. }
  45. #shFxInput {
  46. flex: 1 1 auto;
  47. height: 26px;
  48. border: 1px solid transparent;
  49. border-radius: 4px;
  50. background: transparent;
  51. color: var(--of-fg);
  52. font-size: 13px;
  53. font-family: Consolas, "Courier New", monospace;
  54. outline: none;
  55. padding: 0 6px;
  56. }
  57. #shFxInput:focus { border-color: var(--of-accent); background: var(--of-chrome-bg2); }
  58. /* ============ grid layout ============ */
  59. #workspace { overflow: hidden; display: flex; }
  60. #shGridWrap {
  61. flex: 1 1 auto;
  62. position: relative;
  63. display: grid;
  64. grid-template-columns: 46px 1fr;
  65. grid-template-rows: 24px 1fr;
  66. overflow: hidden;
  67. background: var(--of-bg);
  68. }
  69. #shCorner {
  70. grid-column: 1;
  71. grid-row: 1;
  72. background: var(--sh-headbg);
  73. border-right: 1px solid var(--of-border);
  74. border-bottom: 1px solid var(--of-border);
  75. cursor: pointer;
  76. z-index: 30;
  77. }
  78. #shColHead {
  79. grid-column: 2;
  80. grid-row: 1;
  81. overflow: hidden;
  82. position: relative;
  83. background: var(--sh-headbg);
  84. border-bottom: 1px solid var(--of-border);
  85. z-index: 20;
  86. user-select: none;
  87. }
  88. #shRowHead {
  89. grid-column: 1;
  90. grid-row: 2;
  91. overflow: hidden;
  92. position: relative;
  93. background: var(--sh-headbg);
  94. border-right: 1px solid var(--of-border);
  95. z-index: 20;
  96. user-select: none;
  97. }
  98. #shColHeadIn, #shRowHeadIn { position: absolute; left: 0; top: 0; }
  99. #shGrid {
  100. grid-column: 2;
  101. grid-row: 2;
  102. overflow: auto;
  103. position: relative;
  104. background: var(--of-paper);
  105. }
  106. #shSpacer { position: absolute; left: 0; top: 0; width: 1px; height: 1px; }
  107. #shCells { position: absolute; left: 0; top: 0; }
  108. /* headers */
  109. .sh-colh, .sh-rowh {
  110. position: absolute;
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. font-size: 11px;
  115. color: var(--of-fg-soft);
  116. background: var(--sh-headbg);
  117. box-sizing: border-box;
  118. border-right: 1px solid var(--sh-gridline);
  119. border-bottom: 1px solid var(--sh-gridline);
  120. cursor: pointer;
  121. overflow: hidden;
  122. }
  123. .sh-colh.sel, .sh-rowh.sel {
  124. background: var(--of-accent-soft);
  125. color: var(--of-accent);
  126. font-weight: 600;
  127. }
  128. .sh-rz {
  129. position: absolute;
  130. z-index: 5;
  131. }
  132. .sh-rz-col { top: 0; height: 100%; width: 7px; cursor: col-resize; }
  133. .sh-rz-row { left: 0; width: 100%; height: 7px; cursor: row-resize; }
  134. .sh-rz:hover { background: var(--of-accent-soft); }
  135. .sh-filter-btn {
  136. position: absolute;
  137. right: 1px;
  138. top: 50%;
  139. transform: translateY(-50%);
  140. width: 15px;
  141. height: 15px;
  142. line-height: 13px;
  143. text-align: center;
  144. font-size: 9px;
  145. border-radius: 3px;
  146. background: var(--of-chrome-bg);
  147. border: 1px solid var(--sh-gridline);
  148. color: var(--of-fg-soft);
  149. cursor: pointer;
  150. z-index: 6;
  151. }
  152. .sh-filter-btn.on { background: var(--of-accent); color: #fff; border-color: var(--of-accent); }
  153. /* cells */
  154. .sh-cell {
  155. position: absolute;
  156. box-sizing: border-box;
  157. border-right: 1px solid var(--sh-gridline);
  158. border-bottom: 1px solid var(--sh-gridline);
  159. padding: 0 4px;
  160. font-size: 13px;
  161. color: var(--of-fg);
  162. background: var(--of-paper);
  163. display: flex;
  164. align-items: center;
  165. overflow: hidden;
  166. white-space: pre;
  167. cursor: cell;
  168. user-select: none;
  169. }
  170. .sh-cell.num { justify-content: flex-end; }
  171. .sh-cell.ctr { justify-content: center; }
  172. .sh-cell.rgt { justify-content: flex-end; }
  173. .sh-cell.lft { justify-content: flex-start; }
  174. .sh-cell.wrap { white-space: pre-wrap; word-break: break-word; align-items: flex-start; }
  175. .sh-cell.sel { background-color: var(--sh-sel-bg); }
  176. .sh-cell.err { color: var(--of-danger); }
  177. .sh-cell.b { font-weight: 700; }
  178. .sh-cell.i { font-style: italic; }
  179. .sh-cell.u { text-decoration: underline; }
  180. .sh-cell.frozen { z-index: 12; }
  181. .sh-cell.frozen-corner { z-index: 14; }
  182. /* active cell + range border + fill handle */
  183. #shRangeBox {
  184. position: absolute;
  185. border: 2px solid var(--of-accent);
  186. pointer-events: none;
  187. box-sizing: border-box;
  188. display: none;
  189. z-index: 15;
  190. }
  191. #shFillHandle {
  192. position: absolute;
  193. width: 8px;
  194. height: 8px;
  195. background: var(--of-accent);
  196. border: 1px solid var(--of-paper);
  197. box-sizing: border-box;
  198. cursor: crosshair;
  199. display: none;
  200. z-index: 16;
  201. }
  202. #shGrid.sh-filling, #shGrid.sh-filling .sh-cell { cursor: crosshair; }
  203. /* grabbing the selection border moves the block - the rule has to name
  204. .sh-cell too, since each cell's own `cursor: cell` beats the container's */
  205. #shGrid.sh-movesel, #shGrid.sh-movesel .sh-cell { cursor: move; }
  206. /* floating cell editor */
  207. #shCellInput {
  208. position: absolute;
  209. display: none;
  210. z-index: 40;
  211. border: 2px solid var(--of-accent);
  212. outline: none;
  213. resize: none;
  214. padding: 1px 3px;
  215. font-size: 13px;
  216. font-family: inherit;
  217. background: var(--of-paper);
  218. color: var(--of-fg);
  219. box-sizing: border-box;
  220. overflow: hidden;
  221. line-height: 20px;
  222. }
  223. /* charts layer */
  224. #shChartLayer { position: absolute; left: 0; top: 0; z-index: 25; }
  225. .sh-chart {
  226. position: absolute;
  227. background: var(--of-chrome-bg);
  228. border: 1px solid var(--of-border);
  229. border-radius: 6px;
  230. box-shadow: 0 2px 10px var(--of-shadow);
  231. box-sizing: border-box;
  232. padding: 4px;
  233. color: var(--of-fg);
  234. cursor: move;
  235. overflow: hidden;
  236. }
  237. .sh-chart.sel { border: 2px solid var(--of-accent); }
  238. .sh-chart-rz {
  239. position: absolute;
  240. right: 0;
  241. bottom: 0;
  242. width: 14px;
  243. height: 14px;
  244. cursor: nwse-resize;
  245. background:
  246. linear-gradient(135deg, transparent 50%, var(--of-fg-soft) 50%);
  247. opacity: 0.5;
  248. border-bottom-right-radius: 6px;
  249. }
  250. /* ============ sheet tabs ============ */
  251. #shTabs {
  252. display: flex;
  253. align-items: center;
  254. gap: 2px;
  255. padding: 2px 6px;
  256. background: var(--of-chrome-bg);
  257. border-top: 1px solid var(--of-border);
  258. flex: 0 0 auto;
  259. user-select: none;
  260. overflow-x: auto;
  261. }
  262. #shAddSheet {
  263. border: none;
  264. background: transparent;
  265. color: var(--of-fg-soft);
  266. width: 28px;
  267. height: 26px;
  268. border-radius: 4px;
  269. cursor: pointer;
  270. flex: 0 0 auto;
  271. }
  272. #shAddSheet:hover { background: var(--of-hover); color: var(--of-fg); }
  273. #shAddSheet i.icon { margin: 0 !important; }
  274. #shTabList { display: flex; gap: 2px; }
  275. .sh-tab {
  276. display: flex;
  277. align-items: center;
  278. gap: 6px;
  279. padding: 3px 14px;
  280. border-radius: 4px 4px 0 0;
  281. font-size: 13px;
  282. color: var(--of-fg-soft);
  283. cursor: pointer;
  284. white-space: nowrap;
  285. border-top: 3px solid transparent;
  286. }
  287. .sh-tab:hover { background: var(--of-hover); }
  288. .sh-tab.active {
  289. background: var(--of-chrome-bg2);
  290. color: var(--of-fg);
  291. font-weight: 600;
  292. }
  293. .sh-tab .sh-tab-color {
  294. width: 8px;
  295. height: 8px;
  296. border-radius: 50%;
  297. flex: 0 0 auto;
  298. }
  299. /* filter dialog list */
  300. .sh-filter-list {
  301. max-height: 40vh;
  302. overflow-y: auto;
  303. border: 1px solid var(--of-border);
  304. border-radius: 4px;
  305. padding: 6px;
  306. margin-top: 6px;
  307. }
  308. .sh-filter-list label {
  309. display: flex !important;
  310. align-items: center;
  311. gap: 6px;
  312. margin: 2px 0 !important;
  313. color: var(--of-fg) !important;
  314. cursor: pointer;
  315. }
  316. .sh-filter-list input[type="checkbox"] { width: auto !important; }
  317. /* chart dialog data grid (shared look with slides) */
  318. .sh-grid-table { border-collapse: collapse; width: 100%; }
  319. .sh-grid-table td { padding: 1px; }
  320. .sh-grid-table input {
  321. width: 100%;
  322. box-sizing: border-box;
  323. padding: 4px 6px;
  324. border: 1px solid var(--of-border);
  325. border-radius: 3px;
  326. background: var(--of-chrome-bg2);
  327. color: var(--of-fg);
  328. font-size: 12px;
  329. outline: none;
  330. }
  331. .sh-dialog-row { display: flex; gap: 10px; }
  332. .sh-dialog-row > div { flex: 1; }
  333. /* ============ print ============ */
  334. #shPrintArea { display: none; }
  335. @media print {
  336. #workspace, #shFxBar, #shTabs { display: none !important; }
  337. #shPrintArea { display: block !important; }
  338. #shPrintArea table { border-collapse: collapse; font-size: 11px; }
  339. #shPrintArea td, #shPrintArea th {
  340. border: 1px solid #999;
  341. padding: 2px 6px;
  342. white-space: pre;
  343. }
  344. }
  345. /* touch */
  346. @media (pointer: coarse) {
  347. .sh-rz-col { width: 12px; }
  348. .sh-rz-row { height: 12px; }
  349. }
  350. /* cell note indicator: small corner triangle, note text in the title tooltip */
  351. .sh-cell.note::after {
  352. content: "";
  353. position: absolute;
  354. top: 0;
  355. right: 0;
  356. border: 4px solid transparent;
  357. border-top-color: #e8a13c;
  358. border-right-color: #e8a13c;
  359. }