@brillout/docpress 0.7.9-commit-ea6d0e2 → 0.7.9-commit-30ac702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -120,12 +120,14 @@ html.navigation-fullscreen {
|
|
|
120
120
|
}
|
|
121
121
|
html.navigation-fullscreen #navigation-body {
|
|
122
122
|
display: flex;
|
|
123
|
+
justify-content: center;
|
|
123
124
|
}
|
|
124
125
|
html.navigation-fullscreen #navigation-content-main {
|
|
125
126
|
flex-grow: 1;
|
|
126
|
-
display: grid;
|
|
127
127
|
margin-top: -25px;
|
|
128
|
+
column-gap: 20px;
|
|
128
129
|
}
|
|
129
130
|
html.navigation-fullscreen .nav-items-group {
|
|
130
|
-
|
|
131
|
+
break-inside: avoid;
|
|
132
|
+
width: 100%;
|
|
131
133
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
export { getCSSForResponsiveFullcreenNavItems }
|
|
2
2
|
|
|
3
|
+
// There doens't seem to be as simpler way to have a column layout that uses the whole width real estate.
|
|
4
|
+
// - https://stackoverflow.com/questions/9683425/css-column-count-not-respected
|
|
5
|
+
// - https://stackoverflow.com/questions/25446921/get-flexbox-column-wrap-to-use-full-width-and-minimize-height
|
|
6
|
+
// - https://stackoverflow.com/questions/74873283/how-to-create-a-css-grid-with-3-columns-having-column-flow
|
|
7
|
+
// - https://stackoverflow.com/questions/50693793/3-columns-grid-top-to-bottom-using-grid-css
|
|
8
|
+
// - https://stackoverflow.com/questions/9119347/html-css-vertical-flow-layout-columnar-style-how-to-implement
|
|
9
|
+
// - https://stackoverflow.com/questions/27119691/how-to-start-a-new-column-in-flex-column-wrap-layout
|
|
10
|
+
// - https://stackoverflow.com/questions/45264354/is-it-possible-to-place-more-than-one-element-into-a-css-grid-cell-without-overl/49047281#49047281
|
|
11
|
+
|
|
3
12
|
import assert from 'assert'
|
|
4
13
|
import { type NavItemGrouped } from '../navigation/Navigation'
|
|
5
14
|
|
|
@@ -14,18 +23,18 @@ function getCSSForResponsiveFullcreenNavItems(navItemsGrouped: NavItemGrouped[])
|
|
|
14
23
|
...[
|
|
15
24
|
//
|
|
16
25
|
` html.navigation-fullscreen #navigation-content-main {`,
|
|
17
|
-
`
|
|
18
|
-
`
|
|
26
|
+
` column-count: ${numberOfColumns};`,
|
|
27
|
+
` max-width: min(100%, ${columnWidthMax * numberOfColumns}px);`,
|
|
19
28
|
` }`,
|
|
20
29
|
],
|
|
21
30
|
)
|
|
22
31
|
const columnsIdMap = determineColumns(columnsUnmerged, numberOfColumns)
|
|
23
|
-
columnsIdMap.forEach((
|
|
32
|
+
columnsIdMap.forEach((columnBreakPoint, columnUngroupedId) => {
|
|
24
33
|
CSS_block.push(
|
|
25
34
|
...[
|
|
26
35
|
//
|
|
27
36
|
` .nav-items-group:nth-child(${columnUngroupedId + 1}) {`,
|
|
28
|
-
`
|
|
37
|
+
` break-after: ${columnBreakPoint ? 'column' : 'avoid'};`,
|
|
29
38
|
` }`,
|
|
30
39
|
],
|
|
31
40
|
)
|
|
@@ -45,6 +54,24 @@ function getCSSForResponsiveFullcreenNavItems(navItemsGrouped: NavItemGrouped[])
|
|
|
45
54
|
return CSS
|
|
46
55
|
}
|
|
47
56
|
|
|
57
|
+
function determineColumnBreakPoints(columnsIdMap: number[]): boolean[] {
|
|
58
|
+
assert(columnsIdMap[0] === 0)
|
|
59
|
+
let columnGroupedIdBefore = 0
|
|
60
|
+
const columnBreakPoints = columnsIdMap.map((columnGroupedId, columnUngroupedId) => {
|
|
61
|
+
assert(
|
|
62
|
+
[
|
|
63
|
+
//
|
|
64
|
+
columnGroupedIdBefore,
|
|
65
|
+
columnGroupedIdBefore + 1,
|
|
66
|
+
].includes(columnGroupedId),
|
|
67
|
+
)
|
|
68
|
+
const val = columnGroupedId !== columnGroupedIdBefore
|
|
69
|
+
columnGroupedIdBefore = columnGroupedId
|
|
70
|
+
return val
|
|
71
|
+
})
|
|
72
|
+
return columnBreakPoints
|
|
73
|
+
}
|
|
74
|
+
|
|
48
75
|
function determineColumns(columnsUnmerged: number[], numberOfColumns: number): number[] {
|
|
49
76
|
assert(numberOfColumns <= columnsUnmerged.length)
|
|
50
77
|
const columnsMergingInit: ColumnMerging[] = columnsUnmerged.map((columnHeight, i) => ({
|
|
@@ -60,6 +87,7 @@ function determineColumns(columnsUnmerged: number[], numberOfColumns: number): n
|
|
|
60
87
|
})
|
|
61
88
|
})
|
|
62
89
|
assert(columnsIdMap.length === columnsUnmerged.length)
|
|
90
|
+
|
|
63
91
|
return columnsIdMap
|
|
64
92
|
}
|
|
65
93
|
type ColumnMerging = { columnIdsMerged: number[]; heightTotal: number }
|