tab1.page.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* 设置页面背景色 */
  2. ion-content {
  3. --background: #f9f9f9; /* 设置内容背景色 */
  4. }
  5. /* 设置卡片的样式 */
  6. ion-card {
  7. margin: 10px; /* 卡片之间的间距 */
  8. border-radius: 10px; /* 圆角效果 */
  9. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
  10. }
  11. /* 设置列表项的样式 */
  12. ion-item {
  13. margin: 5px 0; /* 列表项之间的间距 */
  14. }
  15. ion-button {
  16. font-size: 15px; /* 增大字体大小 */
  17. margin-top: 8px; /* 上间距,仅在需要时添加 */
  18. text-transform: none; /* 按钮文字不变形 */
  19. height: 35px;
  20. }
  21. /* 设置搜索框的样式 */
  22. ion-searchbar {
  23. padding: 10px; /* 内边距 */
  24. border-radius: 4px; /* 圆角 */
  25. font-size: 16px; /* 字体大小 */
  26. }
  27. /* 设置用户评价星星的样式 */
  28. ion-icon[name="star"] {
  29. color: gold; /* 星星颜色 */
  30. font-size: 1.2rem; /* 星星大小 */
  31. }
  32. ion-card-header {
  33. --background: #ffffff; /* 使用CSS变量设置背景颜色为白色 */
  34. /* 或者,如果你不使用CSS变量,可以直接使用background-color属性 */
  35. position: relative; /* 设置相对定位 */
  36. }
  37. /* 实际上,ion-toolbar默认会继承ion-card-header的样式,但你可以显式地设置它以确保一致性 */
  38. ion-toolbar {
  39. --background: #ffffff; /* 同样使用CSS变量,但通常不是必需的 */
  40. }
  41. /* 确保按钮的文本颜色是白色 */
  42. .button-text {
  43. color: #ffffff !important; /* 使用!important可以确保这个规则具有更高的优先级,但通常不推荐,除非确实需要 */
  44. /* 然而,在这个例子中,由于按钮本身可能有自己的颜色设置,你可能不需要为.button-text设置颜色,
  45. 而是应该确保按钮的color属性正确,并在需要时覆盖按钮的默认颜色设置 */
  46. }
  47. ion-avatar {
  48. width: 50px; /* 或者你需要的任何尺寸 */
  49. height: 50px; /* 保持宽高一致,避免变形 */
  50. }
  51. ion-avatar img {
  52. width: 100%; /* 让图片填满avatar */
  53. height: auto; /* 保持图片比例 */
  54. }
  55. .header-image {
  56. width: 100%;
  57. height: auto; /* 保持图片比例 */
  58. border-radius: 50%; /* 可选:将图片设置为圆形 */
  59. }