tailwind.config.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. const defaultTheme = require('tailwindcss/defaultTheme')
  2. const round = (num) =>
  3. num
  4. .toFixed(7)
  5. .replace(/(\.[0-9]+?)0+$/, '$1')
  6. .replace(/\.0$/, '')
  7. const rem = (px) => `${round(px / 16)}rem`
  8. const em = (px, base) => `${round(px / base)}em`
  9. const headerFont = {
  10. fontFamily: 'Oswald',
  11. fontWeight: 'normal',
  12. };
  13. module.exports = {
  14. purge: [
  15. './**/*.php'
  16. ],
  17. theme: {
  18. extend: {
  19. fontFamily: {
  20. 'sans': ['"Open Sans"', ...defaultTheme.fontFamily.sans]
  21. },
  22. colors: {
  23. links: 'hsl(205, 50%, 50%)',
  24. footer: 'hsl(205, 50%, 60%)',
  25. footerLinks: 'hsl(205, 33%, 80%)',
  26. },
  27. screens: {
  28. ti: { min: '359px' },
  29. print: { raw: 'print' },
  30. },
  31. },
  32. typography: (theme) => ({
  33. default: {
  34. css: {
  35. h1: { ...headerFont, fontSize: defaultTheme.fontSize['4xl'], lineHeight: '0.7778em' },
  36. h2: { ...headerFont, fontSize: defaultTheme.fontSize['3xl'], lineHeight: '0.7778em' },
  37. h3: { ...headerFont, fontSize: defaultTheme.fontSize['2xl'], lineHeight: '0.9333em' },
  38. h4: { ...headerFont, fontSize: defaultTheme.fontSize['xl'], lineHeight: '1.1667em' },
  39. a: {
  40. textDecoration: 'none',
  41. color: theme('colors.links'),
  42. },
  43. img: {
  44. marginTop: rem(16),
  45. marginBottom: rem(16),
  46. }
  47. }
  48. },
  49. }),
  50. },
  51. variants: {},
  52. plugins: [
  53. require('@tailwindcss/typography'),
  54. ],
  55. future: {
  56. removeDeprecatedGapUtilities: true,
  57. }
  58. }