page-news.component.scss 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* page-news.component.scss */
  2. /* 设置全局样式 */
  3. ion-header {
  4. background-color: #f8f9fa; /* 浅色背景 */
  5. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
  6. }
  7. ion-toolbar {
  8. --background: #ffffff; /* 工具栏背景 */
  9. }
  10. ion-title {
  11. font-size: 1.5rem; /* 增加标题字体大小 */
  12. color: #333; /* 深色字体 */
  13. }
  14. /* 内容样式 */
  15. ion-content {
  16. background-color: #f0f2f5; /* 页面背景 */
  17. padding: 16px; /* 内边距 */
  18. }
  19. /* 列表样式 */
  20. ion-list {
  21. --ion-item-background: transparent; /* 透明背景 */
  22. --ion-item-border-color: transparent; /* 透明边框 */
  23. }
  24. /* 每个新闻项 */
  25. ion-item {
  26. background: white; /* 每个新闻项的背景 */
  27. border-radius: 8px; /* 圆角 */
  28. margin-bottom: 16px; /* 下边距 */
  29. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 阴影 */
  30. transition: transform 0.2s, box-shadow 0.2s; /* 动画效果 */
  31. &:hover {
  32. transform: translateY(-2px); /* 悬停效果 */
  33. box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* 悬停阴影 */
  34. }
  35. }
  36. /* 缩略图样式 */
  37. ion-thumbnail {
  38. border-radius: 8px; /* 圆角 */
  39. overflow: hidden; /* 防止图片溢出 */
  40. }
  41. /* 图片样式 */
  42. ion-thumbnail img {
  43. width: 100%; /* 图片宽度100% */
  44. height: auto; /* 高度自适应 */
  45. }
  46. /* 标签样式 */
  47. ion-label {
  48. padding: 8px; /* 内边距 */
  49. color: #555; /* 标签颜色 */
  50. }
  51. /* 标题样式 */
  52. h2 {
  53. font-size: 1.2rem; /* 标题字体大小 */
  54. color: #333; /* 深色字体 */
  55. margin: 0; /* 去掉默认外边距 */
  56. }
  57. /* 日期样式 */
  58. h3 {
  59. font-size: 1rem; /* 日期字体大小 */
  60. color: #888; /* 灰色字体 */
  61. margin: 4px 0; /* 上下边距 */
  62. }
  63. /* 描述样式 */
  64. p {
  65. font-size: 0.9rem; /* 描述字体大小 */
  66. line-height: 1.5; /* 行高 */
  67. color: #666; /* 中灰色字体 */
  68. margin: 0; /* 去掉默认外边距 */
  69. }