diff options
| author | PgBiel <9021226+PgBiel@users.noreply.github.com> | 2024-02-22 05:42:10 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-22 08:42:10 +0000 |
| commit | a8671962d6cfde985c49e0ca8ebc27ed4c9118cc (patch) | |
| tree | f9fb06446bb9e40065b6d31d4056ea4529b8b2e8 /tests/typ | |
| parent | 92a2f01b7488432df8bd6ed37b7565e39cd76f93 (diff) | |
Some table improvements [More flexible tables] (#3473)
Diffstat (limited to 'tests/typ')
| -rw-r--r-- | tests/typ/layout/grid-cell.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/grid-stroke.typ | 18 | ||||
| -rw-r--r-- | tests/typ/layout/grid-styling.typ | 26 | ||||
| -rw-r--r-- | tests/typ/layout/table-cell.typ | 4 | ||||
| -rw-r--r-- | tests/typ/layout/table.typ | 26 |
5 files changed, 77 insertions, 1 deletions
diff --git a/tests/typ/layout/grid-cell.typ b/tests/typ/layout/grid-cell.typ index 425d036c..a812fefc 100644 --- a/tests/typ/layout/grid-cell.typ +++ b/tests/typ/layout/grid-cell.typ @@ -127,3 +127,7 @@ [Jake], [49], [Epic] ) } + +--- +// Error: 7-19 cannot use `table.cell` as a grid cell; use `grid.cell` instead +#grid(table.cell[]) diff --git a/tests/typ/layout/grid-stroke.typ b/tests/typ/layout/grid-stroke.typ index 87389ad5..51b810d9 100644 --- a/tests/typ/layout/grid-stroke.typ +++ b/tests/typ/layout/grid-stroke.typ @@ -139,7 +139,7 @@ --- // Line specification order priority // The last line should be blue, not red. -// The middle line should have disappeared. +// The middle aqua line should be gone due to the 'none' override. #grid( columns: 2, inset: 2pt, @@ -345,6 +345,22 @@ ) --- +// Error: 7-20 cannot use `table.hline` as a grid line; use `grid.hline` instead +#grid(table.hline()) + +--- +// Error: 7-20 cannot use `table.vline` as a grid line; use `grid.vline` instead +#grid(table.vline()) + +--- +// Error: 8-20 cannot use `grid.hline` as a table line; use `table.hline` instead +#table(grid.hline()) + +--- +// Error: 8-20 cannot use `grid.vline` as a table line; use `table.vline` instead +#table(grid.vline()) + +--- // Error: 3:3-3:31 line cannot end before it starts #grid( columns: 3, diff --git a/tests/typ/layout/grid-styling.typ b/tests/typ/layout/grid-styling.typ index e076d0c4..f83c3cc4 100644 --- a/tests/typ/layout/grid-styling.typ +++ b/tests/typ/layout/grid-styling.typ @@ -88,6 +88,32 @@ a [B], ) +#grid( + columns: 3, + fill: (x, y) => (if y == 0 { aqua } else { orange }).darken(x * 15%), + inset: (x, y) => (left: if x == 0 { 0pt } else { 5pt }, right: if x == 0 { 5pt } else { 0pt }, y: if y == 0 { 0pt } else { 5pt }), + [A], [B], [C], + [A], [B], [C], +) + +#grid( + columns: 3, + inset: (0pt, 5pt, 10pt), + fill: (x, _) => aqua.darken(x * 15%), + [A], [B], [C], +) + +--- +// Test inset folding +#set grid(inset: 10pt) +#set grid(inset: (left: 0pt)) + +#grid( + fill: red, + inset: (right: 0pt), + grid.cell(inset: (top: 0pt))[a] +) + --- // Test interaction with gutters. #grid( diff --git a/tests/typ/layout/table-cell.typ b/tests/typ/layout/table-cell.typ index d79298ae..cbe0b9f0 100644 --- a/tests/typ/layout/table-cell.typ +++ b/tests/typ/layout/table-cell.typ @@ -122,3 +122,7 @@ [Jake], [49], [Epic] ) } + +--- +// Error: 8-19 cannot use `grid.cell` as a table cell; use `table.cell` instead +#table(grid.cell[]) diff --git a/tests/typ/layout/table.typ b/tests/typ/layout/table.typ index 1b250aa4..89a7dab5 100644 --- a/tests/typ/layout/table.typ +++ b/tests/typ/layout/table.typ @@ -61,6 +61,32 @@ [B], ) +#table( + columns: 3, + fill: (x, y) => (if y == 0 { aqua } else { orange }).darken(x * 15%), + inset: (x, y) => (left: if x == 0 { 0pt } else { 5pt }, right: if x == 0 { 5pt } else { 0pt }, y: if y == 0 { 0pt } else { 5pt }), + [A], [B], [C], + [A], [B], [C], +) + +#table( + columns: 3, + inset: (0pt, 5pt, 10pt), + fill: (x, _) => aqua.darken(x * 15%), + [A], [B], [C], +) + +--- +// Test inset folding +#set table(inset: 10pt) +#set table(inset: (left: 0pt)) + +#table( + fill: red, + inset: (right: 0pt), + table.cell(inset: (top: 0pt))[a] +) + --- // Test interaction with gutters. #table( |
