demo3.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div class="m-color__list">
  3. <div v-for="(item, index) in state.colorObjList" :key="index"
  4. :style="{ backgroundColor: item.bgColor, color: item.color }" class="m-color__item"
  5. :class="'item__' + index">
  6. <p class="m-color__title">{{ item.title }}</p>
  7. <p class="m-color__desc">{{ item.bgColor }}</p>
  8. </div>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { reactive } from 'vue-demi';
  13. const state = reactive({
  14. colorObjList: [
  15. {
  16. title: 'Primary Text',
  17. bgColor: '#303133',
  18. color: '#fff'
  19. }, {
  20. title: 'Darker Border',
  21. bgColor: '#CDD0D6',
  22. color: '#333'
  23. }, {
  24. title: 'Darker Fill',
  25. bgColor: '#E6E8EB',
  26. color: '#333'
  27. }, {
  28. title: 'Basic Black',
  29. bgColor: '#000000',
  30. color: '#fff'
  31. }, {
  32. title: 'Regular Text',
  33. bgColor: '#606266',
  34. color: '#fff'
  35. }, {
  36. title: 'Dark Border',
  37. bgColor: '#D4D7DE',
  38. color: '#333'
  39. }, {
  40. title: 'Dark Fill',
  41. bgColor: '#EBEDF0',
  42. color: '#333'
  43. }, {
  44. title: 'Basic White',
  45. bgColor: '#FFFFFF',
  46. color: '#333'
  47. }, {
  48. title: 'Secondary Text',
  49. bgColor: '#909399',
  50. color: '#fff'
  51. }, {
  52. title: 'Base Border',
  53. bgColor: '#DCDFE6',
  54. color: '#333'
  55. }, {
  56. title: 'Base Fill',
  57. bgColor: '#F0F2F5',
  58. color: '#333'
  59. }, {
  60. title: 'Transparent',
  61. bgColor: '#Transparent',
  62. color: '#333'
  63. }, {
  64. title: 'Placeholder Text',
  65. bgColor: '#A8ABB2',
  66. color: '#fff'
  67. }, {
  68. title: 'Light Border',
  69. bgColor: '#E4E7ED',
  70. color: '#333'
  71. }, {
  72. title: 'Light Fill',
  73. bgColor: '#F5F7FA',
  74. color: '#333'
  75. }, {
  76. title: 'Page Background',
  77. bgColor: '#F2F3F5',
  78. color: '#333'
  79. }, {
  80. title: 'Disabled Text',
  81. bgColor: '#C0C4CC',
  82. color: '#333'
  83. }, {
  84. title: 'Lighter Border',
  85. bgColor: '#EBEEF5',
  86. color: '#333'
  87. }, {
  88. title: 'Lighter Fill',
  89. bgColor: '#FAFAFA',
  90. color: '#333'
  91. }, {
  92. title: 'Base Background',
  93. bgColor: '#FFFFFF',
  94. color: '#333'
  95. }, {
  96. title: 'Extra-light Border',
  97. bgColor: '#F2F6FC',
  98. color: '#333'
  99. }, {
  100. title: 'Extra-light Fill',
  101. bgColor: '#FAFCFF',
  102. color: '#333'
  103. }, {
  104. title: 'Overlay Background',
  105. bgColor: '#FFFFFF',
  106. color: '#333'
  107. }, {
  108. title: 'Blank Fill',
  109. bgColor: '#FFFFFF',
  110. color: '#333'
  111. }
  112. ]
  113. })
  114. </script>
  115. <style lang="scss" scoped>
  116. // @import '../../styles/components/button.scss';
  117. .m-color__list {
  118. display: flex;
  119. flex-wrap: wrap;
  120. width: 1300px;
  121. margin-left: -10px;
  122. .m-color__item {
  123. width: 190px;
  124. height: 112px;
  125. margin: 10px 0 0 10px;
  126. border-radius: 5px;
  127. .m-color__title {
  128. font-size: 16px;
  129. margin-top: 20px;
  130. margin-left: 20px;
  131. }
  132. .m-color__desc {
  133. font-size: 14px;
  134. margin-top: 10px;
  135. margin-left: 20px;
  136. }
  137. }
  138. .item__11 {
  139. /* 马赛克背景图 */
  140. background-position: 0px 0px, 10px 10px;
  141. background-size: 20px 20px;
  142. background-image: linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%), linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);
  143. }
  144. .item__19,.item__22,.item__23 {
  145. box-sizing: border-box;
  146. border: 1px #aeaeae solid;
  147. }
  148. }
  149. </style>