Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind README + ui preview fixes #36

Merged
merged 13 commits into from
Nov 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stylelintrc
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
"rules": {
"comment-empty-line-before": null,
"no-descending-specificity": null,
"at-rule-no-unknown": [true, { "ignoreAtRules": ["include", "mixin", "extend", "content", "if", "else", "for", "each", "while", "function", "return", "warn", "error", "debug"]}]
"at-rule-no-unknown": [true, { "ignoreAtRules": ["include", "mixin", "extend", "content", "if", "else", "for", "each", "while", "function", "return", "warn", "error", "debug", "layer", "apply", "tailwind"]}]
}
}
5 changes: 5 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ endif::[]
:url-datastax-docs-repo: https://github.com/riptano/docs-site
:url-coppi: https://coppi.aws.dsinternal.org
:url-docs-preview: http://docs-preview.datastax.com
:url-tailwind-readme: src/css/tailwind/README.adoc
// External URLs:
:url-antora: https://antora.org
:url-antora-docs: https://docs.antora.org
@@ -285,6 +286,10 @@ SOURCEMAPS=true gulp bundle

In this case, the bundle will include the source maps, which can be used for debugging your production site.

==== Using TailwindCSS

This project uses TailwindCSS. To learn more see xref:{url-tailwind-readme}[TailwindCSS README].

== Release the UI bundle

Once you're satisfied with the changes you've made to the UI, you'll need to open a pull request to merge your changes into the `main` branch.
3 changes: 3 additions & 0 deletions gulp.d/lib/preview.tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const mainConfig = require('../../tailwind.config.js')

module.exports = { ...mainConfig, content: ['public/**/*.{html,js}', 'src/**/*.hbs'] }
8 changes: 6 additions & 2 deletions gulp.d/tasks/build.js
Original file line number Diff line number Diff line change
@@ -11,16 +11,18 @@ const ospath = require('path')
const path = ospath.posix
const postcss = require('gulp-postcss')
const postcssCalc = require('postcss-calc')
const postcssNested = require('postcss-nested')
const postcssAdvancedVars = require('postcss-advanced-variables')
const postcssImport = require('postcss-import')
const tailwindcss = require('tailwindcss')
const tailwindcssNesting = require('tailwindcss/nesting')
const postcssUrl = require('postcss-url')
const postcssVar = require('postcss-custom-properties')
const { Transform } = require('stream')
const map = (transform) => new Transform({ objectMode: true, transform })
const through = () => map((file, enc, next) => next(null, file))
const uglify = require('gulp-uglify')
const vfs = require('vinyl-fs')
const tailwindconfig = require('../lib/preview.tailwind.config')

module.exports = (src, dest, preview) => () => {
const opts = { base: src, cwd: src }
@@ -49,7 +51,9 @@ module.exports = (src, dest, preview) => () => {
},
},
]),
postcssNested,
tailwindcssNesting,
// 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
Loading