const defaultTheme = require('tailwindcss/defaultTheme') const colors = require('tailwindcss/colors') const CLASS_YML_REGEX = /^- "\.([\S-]+)"$/ // for classes in hashes, eg. `SCHEME_CLASS_MAPPINGS` const CLASS_MAPPINGS = '(?:\\S+|:\\"[\\S-]+\\"): \\"([\\S -]+)\\"' // for classes in constants const CLASS_CONSTANT = '[A-Z_]+ = \\"([\\S -]+)\\"' const CLASS_RB_REGEX = new RegExp(`(?:${CLASS_MAPPINGS}|${CLASS_CONSTANT})`, 'g') const resolve = require('path').resolve module.exports = { prefix: 'ariadne-', content: { files: [ resolve(__dirname, 'public/*.html'), resolve(__dirname, 'app/assets/javascripts/**/*.js'), resolve(__dirname, 'app/components/**/*.erb'), resolve(__dirname, 'app/components/**/*.rb'), resolve(__dirname, 'app/lib/ariadne'), resolve(__dirname, 'static/classes.yml') ], extract: { yml: content => { const matches = content.match(CLASS_YML_REGEX) return matches ? matches[1].split(/\s+/) : [] }, rb: content => { const matches = content.match(CLASS_RB_REGEX) if (matches) { const rez = matches[0] .split(/\s+/) .filter(function (m) { return m.match(/ariadne/) }) .map(m => m.replace(/"/, '')) return rez } return [] } } }, plugins: [ require('@tailwindcss/aspect-ratio'), require('@tailwindcss/line-clamp'), require('@tailwindcss/forms'), require('@tailwindcss/typography') ], theme: { extend: { colors: { 'billy-purple': '#a700a0', 'button-text-color': colors.indigo['700'], 'button-bg-color': colors.indigo['100'], 'button-hover-color': colors.indigo['200'], 'list-hover-color': colors.blue['50'], 'filter-panel-color': colors.amber['100'], 'internal-message': colors.amber['100'], 'state-closed': '#da1e28', 'state-open': '#198038' }, fontFamily: { sans: ['Inter var', ...defaultTheme.fontFamily.sans] }, flexBasis: { 160: '40rem' } } } }