Commit 13787db3 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Add tailwind build and config support

parent c12ae5d5
...@@ -10,31 +10,41 @@ import gulp from 'gulp'; ...@@ -10,31 +10,41 @@ import gulp from 'gulp';
import serveDev from './dev-server/serve-dev.js'; import serveDev from './dev-server/serve-dev.js';
import servePackage from './dev-server/serve-package.js'; import servePackage from './dev-server/serve-package.js';
import tailwindConfig from './tailwind.config.mjs';
gulp.task('build-js', () => buildJS('./rollup.config.mjs')); gulp.task('build-js', () => buildJS('./rollup.config.mjs'));
gulp.task('watch-js', () => watchJS('./rollup.config.mjs')); gulp.task('watch-js', () => watchJS('./rollup.config.mjs'));
gulp.task('build-css', () => gulp.task('build-css', () =>
buildCSS([ buildCSS(
// Hypothesis client [
'./src/styles/annotator/annotator.scss', // Hypothesis client
'./src/styles/annotator/highlights.scss', './src/styles/annotator/annotator.scss',
'./src/styles/annotator/pdfjs-overrides.scss', './src/styles/annotator/highlights.scss',
'./src/styles/sidebar/sidebar.scss', './src/styles/annotator/pdfjs-overrides.scss',
'./src/styles/sidebar/sidebar.scss',
// Vendor
'./node_modules/katex/dist/katex.min.css', // Vendor
'./node_modules/katex/dist/katex.min.css',
// Development tools
'./src/styles/ui-playground/ui-playground.scss', // Development tools
]) './src/styles/ui-playground/ui-playground.scss',
],
{ tailwindConfig }
)
); );
gulp.task( gulp.task(
'watch-css', 'watch-css',
gulp.series('build-css', function watchCSS() { gulp.series('build-css', function watchCSS() {
gulp.watch( gulp.watch(
['node_modules/katex/dist/katex.min.css', 'src/styles/**/*.scss'], [
'node_modules/katex/dist/katex.min.css',
'src/styles/**/*.scss',
'src/sidebar/components/**/*.js',
'src/annotator/components/**/*.js',
'dev-server/ui-playground/components/**/*.js',
],
gulp.task('build-css') gulp.task('build-css')
); );
}) })
......
...@@ -29,6 +29,9 @@ ...@@ -29,6 +29,9 @@
// Make the shared package utility styles available // Make the shared package utility styles available
@use '@hypothesis/frontend-shared/styles/util'; @use '@hypothesis/frontend-shared/styles/util';
@tailwind base;
@tailwind utilities;
// Styles for all top-level elements in shadow roots. // Styles for all top-level elements in shadow roots.
:host > * { :host > * {
font-family: var.$sans-font-family; font-family: var.$sans-font-family;
......
...@@ -58,6 +58,9 @@ ...@@ -58,6 +58,9 @@
// Local utility classes // Local utility classes
@use '../util'; @use '../util';
@tailwind base;
@tailwind utilities;
// Top-level styles // Top-level styles
// ---------------- // ----------------
......
import tailwindConfig from '@hypothesis/frontend-shared/lib/tailwind.preset.js';
export default {
presets: [tailwindConfig],
mode: 'jit',
purge: [
'./src/sidebar/components/**/*.js',
'./src/annotator/components/**/*.js',
'./dev-server/ui-playground/components/**/*.js',
],
theme: {},
corePlugins: {
preflight: false, // Disable Tailwind's CSS reset in the `base` layer
},
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment