_code.scss 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. .ui-code {
  2. font-family: Monaco, Menlo, Consolas, 'Courier New';
  3. font-size: 90%;
  4. position: relative;
  5. z-index: 1;
  6. color: var(--ui-TC);
  7. .ui-rich-text {
  8. display: inline-block;
  9. }
  10. &.code {
  11. display: inline-block;
  12. padding: 0 10rpx;
  13. margin: 0 10rpx;
  14. border-radius: $radius-sm;
  15. line-height: 1.6;
  16. vertical-align: baseline;
  17. }
  18. &.pre {
  19. display: block;
  20. margin: 1em 0;
  21. line-height: 1.6;
  22. &.hasTitle {
  23. margin: 3.2em 0 1em;
  24. }
  25. // border-radius: $radius-sm;
  26. .ui-code-title {
  27. position: absolute;
  28. top: -2.2em;
  29. color: var(--ui-TC-2);
  30. left: 0;
  31. }
  32. .ui-rich-text {
  33. padding: 40rpx;
  34. white-space: pre-wrap;
  35. word-break: break-all;
  36. word-wrap: break-word;
  37. }
  38. .ui-scroll-view {
  39. &.ui-scroll {
  40. max-height: 500px;
  41. white-space: pre;
  42. }
  43. }
  44. .ui-copy-btn {
  45. position: absolute;
  46. z-index: 2;
  47. top: 0;
  48. right: 0;
  49. padding: 0.8em;
  50. border-radius: 0 $radius-sm 0 $radius-sm;
  51. }
  52. }
  53. }