Skip to content

Commit

Permalink
New design tokens (#169)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
colegoldsmith authored Nov 8, 2024
1 parent 1cc662a commit a959997
Show file tree
Hide file tree
Showing 38 changed files with 1,102 additions and 585 deletions.
8 changes: 7 additions & 1 deletion gulp.d/tasks/build-preview-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ const yaml = require('js-yaml')

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

const algoliaTestKeys = {
algoliaAppId: 'R2IYF7ETH7',
algoliaIndexName: 'docsearch',
algoliaApiKey: '599cec31baffa4868cae4e79f180729b',
}

module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
Promise.all([
loadSampleUiModel(previewSrc),
Expand All @@ -37,7 +43,7 @@ module.exports = (src, previewSrc, previewDest, sink = () => map()) => (done) =>
for (const component of baseUiModel.site.components) {
for (const version of component.versions || []) version.asciidoc = asciidoc
}
baseUiModel = { ...baseUiModel, env: process.env }
baseUiModel = { ...baseUiModel, env: process.env, site: { ...baseUiModel.site, keys: algoliaTestKeys } }
delete baseUiModel.asciidoc
return [baseUiModel, layouts]
})
Expand Down
10 changes: 5 additions & 5 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ module.exports = (src, dest, preview) => () => {
}),
postcssUrl([
{
filter: (asset) => new RegExp('^[~][^/]*(?:font|typeface)[^/]*/.*/files/.+[.](?:ttf|woff2?)$').test(asset.url),
filter: (asset) => new RegExp('.+[.](?:ttf|woff2?)(?:\\?[^\\s]*)?$').test(asset.url),
url: (asset) => {
const relpath = asset.pathname.substr(1)
let relpath = asset.pathname
if (relpath.includes('lucide')) relpath = `lucide-static/font/${relpath}`
if (relpath.includes('~@fontsource')) relpath = relpath.replace('~', '')
const abspath = require.resolve(relpath)
const basename = ospath.basename(abspath)
const destpath = ospath.join(dest, 'font', basename)
Expand All @@ -57,9 +59,7 @@ module.exports = (src, dest, preview) => () => {
// only run tailwindcss in preview, datastax-docs-site repo has it's own tailwind cli step
preview ? tailwindcss(tailwindconfig) : () => {},
postcssAdvancedVars,
postcssVar({ preserve: preview }),
// NOTE to make vars.css available to all top-level stylesheets, use the next line in place of the previous one
//postcssVar({ importFrom: path.join(src, 'css', 'vars.css'), preserve: preview }),
postcssVar({ preserve: true }),
preview ? postcssCalc : () => {}, // cssnano already applies postcssCalc
autoprefixer,
preview
Expand Down
Loading

0 comments on commit a959997

Please sign in to comment.