tailwind.config.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const generatePrimaryColors = () => {
  2. const result = {
  3. primary: `var(--primary-color)`
  4. }
  5. for (let i = 0; i < 10; i++) {
  6. result[`primary-${i}`] = `var(--primary-${i})`
  7. }
  8. return result
  9. }
  10. const generateFontSize = () => {
  11. const result = {}
  12. for (let i = 10; i < 32; i++) {
  13. result[i] = `${i}px`
  14. }
  15. return result
  16. }
  17. const colors = require('tailwindcss/colors')
  18. const filterWarnColors = (colors) => {
  19. const result = {}
  20. for (const key in colors) {
  21. if (['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray'].indexOf(key) === -1) {
  22. result[key] = colors[key]
  23. }
  24. }
  25. return result
  26. }
  27. module.exports = {
  28. content: ['./src/**/*.vue', './src/**/*.js'],
  29. darkMode: 'class', // or 'media' or 'class'
  30. corePlugins: {
  31. preflight: false
  32. },
  33. theme: {
  34. extend: {},
  35. colors: {
  36. transparent: 'transparent',
  37. current: 'currentColor',
  38. ...filterWarnColors(colors),
  39. ...generatePrimaryColors()
  40. },
  41. fontWeight: {
  42. 1: 100,
  43. 2: 200,
  44. 3: 300,
  45. 4: 400,
  46. 5: 500,
  47. 6: 600,
  48. 7: 700,
  49. 8: 800,
  50. 9: 900
  51. },
  52. fontSize: {
  53. ...generateFontSize()
  54. }
  55. },
  56. variants: {},
  57. plugins: []
  58. }