Skip to content

Commit a959997

Browse files
New design tokens (#169)
* add new tokens as css vars * theme toggle and more updates * fix docsearch background blur * more margin * replace all cdn dependencies, move toggle back to header * rework theme mechanism so toggle buttons are styled right away, add docs for lucide icons * fix build * try fixing docsearch styles * setTheme in head scripts improved * move docsearch styles to vendor folder * preserve css vars in build * Trigger Build * small docsearch styles
1 parent 1cc662a commit a959997

38 files changed

+1102
-585
lines changed

gulp.d/tasks/build-preview-pages.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ const yaml = require('js-yaml')
1414

1515
const ASCIIDOC_ATTRIBUTES = { experimental: '', icons: 'font', sectanchors: '', 'source-highlighter': 'highlight.js' }
1616

17+
const algoliaTestKeys = {
18+
algoliaAppId: 'R2IYF7ETH7',
19+
algoliaIndexName: 'docsearch',
20+
algoliaApiKey: '599cec31baffa4868cae4e79f180729b',
21+
}
22+
1723
module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
1824
Promise.all([
1925
loadSampleUiModel(previewSrc),
@@ -37,7 +43,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
3743
for (const component of baseUiModel.site.components) {
3844
for (const version of component.versions || []) version.asciidoc = asciidoc
3945
}
40-
baseUiModel = { ...baseUiModel, env: process.env }
46+
baseUiModel = { ...baseUiModel, env: process.env, site: { ...baseUiModel.site, keys: algoliaTestKeys } }
4147
delete baseUiModel.asciidoc
4248
return [baseUiModel, layouts]
4349
})

gulp.d/tasks/build.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ module.exports = (src, dest, preview) => () => {
4242
}),
4343
postcssUrl([
4444
{
45-
filter: (asset) => new RegExp('^[~][^/]*(?:font|typeface)[^/]*/.*/files/.+[.](?:ttf|woff2?)$').test(asset.url),
45+
filter: (asset) => new RegExp('.+[.](?:ttf|woff2?)(?:\\?[^\\s]*)?$').test(asset.url),
4646
url: (asset) => {
47-
const relpath = asset.pathname.substr(1)
47+
let relpath = asset.pathname
48+
if (relpath.includes('lucide')) relpath = `lucide-static/font/${relpath}`
49+
if (relpath.includes('~@fontsource')) relpath = relpath.replace('~', '')
4850
const abspath = require.resolve(relpath)
4951
const basename = ospath.basename(abspath)
5052
const destpath = ospath.join(dest, 'font', basename)
@@ -57,9 +59,7 @@ module.exports = (src, dest, preview) => () => {
5759
// only run tailwindcss in preview, datastax-docs-site repo has it's own tailwind cli step
5860
preview ? tailwindcss(tailwindconfig) : () => {},
5961
postcssAdvancedVars,
60-
postcssVar({ preserve: preview }),
61-
// NOTE to make vars.css available to all top-level stylesheets, use the next line in place of the previous one
62-
//postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }),
62+
postcssVar({ preserve: true }),
6363
preview ? postcssCalc : () => {}, // cssnano already applies postcssCalc
6464
autoprefixer,
6565
preview

0 commit comments

Comments
 (0)