Section.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <section :class = "'with-header-and-content ' + classes" :id = "id">
  3. <div class = "section-header flex-row">
  4. <div class = "fg1">
  5. <h2 :title = "subtitle">{{ title }}</h2>
  6. </div>
  7. <div role = "toolbar">
  8. <slot name="toolbar" />
  9. </div>
  10. </div>
  11. <div :class = "padding ? 'section-content padding' : 'section-content'">
  12. <slot />
  13. </div>
  14. </section>
  15. </template>
  16. <script setup>
  17. const props = defineProps({
  18. title: {
  19. type: String,
  20. default: "Untitled Section",
  21. },
  22. padding: {
  23. type: Boolean,
  24. default: true,
  25. },
  26. subtitle: {
  27. type: String,
  28. default: "",
  29. },
  30. id: {
  31. type: String,
  32. default: "",
  33. },
  34. classes: {
  35. type: String,
  36. default: "",
  37. },
  38. });
  39. </script>
  40. <style scoped>
  41. :slotted(.section-header button).neutral,
  42. :slotted(.section-header .button).neutral
  43. {
  44. background-color: white;
  45. color: #000;
  46. }
  47. :slotted(.section-header .button:hover).neutral,
  48. :slotted(.section-header .button:hover).neutral
  49. {
  50. background-color: #f0f0f0;
  51. }
  52. @media (prefers-color-scheme: dark) {
  53. :slotted(.section-header button).neutral,
  54. :slotted(.section-header .button).neutral
  55. {
  56. background-color: #111;
  57. border: 1px solid #222;
  58. color: #fff;
  59. }
  60. :slotted(.section-header button:hover).neutral,
  61. :slotted(.section-header .button:hover).neutral
  62. {
  63. background-color: #222;
  64. border: 1px solid #333;
  65. color: #fff;
  66. }
  67. }
  68. </style>