Skip to content

Commit 9c1f075

Browse files
committed
fix: update default table border size in @superdoc/contracts
Unclear where the original 0.5 value came from; change it to 1 to reflect the default value used in rendering table borders.
1 parent db79dec commit 9c1f075

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

packages/layout-engine/contracts/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ export type CompleteTableCellAttrs = DeepRequired<TableCellAttrs>;
445445

446446
export const defaultTableCellAttrs: DeepReadonly<CompleteTableCellAttrs> = {
447447
borders: {
448-
top: { style: 'single', width: 0.5, color: 'auto', space: 0 },
449-
right: { style: 'single', width: 0.5, color: 'auto', space: 0 },
450-
bottom: { style: 'single', width: 0.5, color: 'auto', space: 0 },
451-
left: { style: 'single', width: 0.5, color: 'auto', space: 0 },
448+
top: { style: 'single', width: 1, color: 'auto', space: 0 },
449+
right: { style: 'single', width: 1, color: 'auto', space: 0 },
450+
bottom: { style: 'single', width: 1, color: 'auto', space: 0 },
451+
left: { style: 'single', width: 1, color: 'auto', space: 0 },
452452
},
453453
padding: {
454454
top: 2,

packages/layout-engine/measuring/dom/src/table-utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,5 @@ export function getBorderWidth(border: BorderSpec | null | undefined): number {
55
return 0;
66
}
77

8-
// TODO: Is there a reason the default is different from the default border weight in defaultTableCellAttrs.borders?
9-
// (This is the same default value used in applyBorder() in painters/dom/src/table/border-utils.ts)
108
return border.width ?? 1;
119
}

packages/layout-engine/painters/dom/src/table/border-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const applyBorder = (
8686
}
8787

8888
const style = borderStyleToCSS(border.style);
89-
const width = border.width ?? 1; // TODO: Is there a reason this is different from the default border weight in defaultTableCellAttrs.borders?
89+
const width = border.width ?? 1;
9090
const color = border.color ?? '#000000';
9191
const safeColor = isValidHexColor(color) ? color : '#000000';
9292
const actualWidth = border.style === 'thick' ? Math.max(width * 2, 3) : width;

0 commit comments

Comments
 (0)