You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tailwind-utilities.js 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. const plugin = require('tailwindcss/plugin');
  21. module.exports = plugin(({ addUtilities, theme }) => {
  22. const newUtilities = {
  23. '.heading-xl': {
  24. 'font-family': theme('fontFamily.sans'),
  25. 'font-size': theme('fontSize.xl'),
  26. 'line-height': theme('fontSize').xl[1],
  27. 'font-weight': theme('fontWeight.semibold'),
  28. },
  29. '.heading-lg': {
  30. 'font-family': theme('fontFamily.sans'),
  31. 'font-size': theme('fontSize.lg'),
  32. 'line-height': theme('fontSize').lg[1],
  33. 'font-weight': theme('fontWeight.semibold'),
  34. },
  35. '.heading-md': {
  36. 'font-family': theme('fontFamily.sans'),
  37. 'font-size': theme('fontSize.md'),
  38. 'line-height': theme('fontSize').md[1],
  39. 'font-weight': theme('fontWeight.semibold'),
  40. },
  41. '.body-md': {
  42. 'font-family': theme('fontFamily.sans'),
  43. 'font-size': theme('fontSize.base'),
  44. 'line-height': theme('fontSize').base[1],
  45. 'font-weight': theme('fontWeight.regular'),
  46. },
  47. '.body-md-highlight': {
  48. 'font-family': theme('fontFamily.sans'),
  49. 'font-size': theme('fontSize.base'),
  50. 'line-height': theme('fontSize').base[1],
  51. 'font-weight': theme('fontWeight.semibold'),
  52. },
  53. '.body-sm': {
  54. 'font-family': theme('fontFamily.sans'),
  55. 'font-size': theme('fontSize.sm'),
  56. 'line-height': theme('fontSize').sm[1],
  57. 'font-weight': theme('fontWeight.regular'),
  58. },
  59. '.body-xs': {
  60. 'font-family': theme('fontFamily.sans'),
  61. 'font-size': theme('fontSize.xs'),
  62. 'line-height': theme('fontSize').xs[1],
  63. 'font-weight': theme('fontWeight.regular'),
  64. },
  65. '.body-sm-highlight': {
  66. 'font-family': theme('fontFamily.sans'),
  67. 'font-size': theme('fontSize.sm'),
  68. 'line-height': theme('fontSize').sm[1],
  69. 'font-weight': theme('fontWeight.semibold'),
  70. },
  71. '.code': {
  72. 'font-family': theme('fontFamily.mono'),
  73. 'font-size': theme('fontSize.sm'),
  74. 'line-height': theme('fontSize').code[1],
  75. 'font-weight': theme('fontWeight.regular'),
  76. },
  77. '.code-highlight': {
  78. 'font-family': theme('fontFamily.mono'),
  79. 'font-size': theme('fontSize.sm'),
  80. 'line-height': theme('fontSize').code[1],
  81. 'font-weight': theme('fontWeight.bold'),
  82. },
  83. '.code-comment': {
  84. 'font-family': theme('fontFamily.mono'),
  85. 'font-size': theme('fontSize.sm'),
  86. 'line-height': theme('fontSize').code[1],
  87. 'font-style': 'italic',
  88. },
  89. };
  90. addUtilities(newUtilities);
  91. });