Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

2.0 KB
Raw Blame
@use "@fider/assets/styles/variables.scss" as *;

.c-markdown,
.tiptap {
  overflow-wrap: break-word;
  word-break: break-word;

  blockquote {
    padding: spacing(2);
    color: var(--colors-gray-900);
    border-inline-start: 4px solid var(--colors-gray-300);
    margin: spacing(1) 0 spacing(1) spacing(4);
    background-color: var(--colors-gray-200);
    border-radius: 4px;
  }

  .mention {
    background-color: var(--colors-blue-100);
    border-radius: get("border.radius.medium");
    box-decoration-break: clone;
    color: var(--colors-blue-600);
    padding-inline-start: spacing(1);
    padding-inline-end: spacing(1);
    padding-top: 4px;
    padding-bottom: 4px;
    &::after {
      content: "\200B";
    }
  }

  h1 {
    font-size: get("font.size.2xl");
  }

  h2 {
    font-size: get("font.size.xl");
    margin: 0 0 14px;
  }

  h3 {
    font-size: get("font.size.lg");
    margin: 0 0 14px;
  }

  li {
    line-height: 1.4;
  }

  ul,
  ol {
    padding-inline-start: spacing(8);
    margin: 0 0 spacing(3);

    &:first-child {
      margin-top: 0;
    }

    &:last-child {
      margin-bottom: 0;
    }
  }

  img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  // Scroll wide tables instead of squashing them; the inherited word-break would
  // otherwise let cells shrink to one letter per line on narrow screens
  table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
  }

  th,
  td {
    word-break: normal;
    padding: spacing(1) spacing(2);
  }

  pre {
    overflow-x: auto;
    padding: spacing(2);
    line-height: 1.45;
    background-color: var(--colors-gray-200);
    border-radius: 4px;

    code {
      display: inline;
      padding: 0;
      margin: 0;
      line-height: inherit;
      word-wrap: normal;
      // background-color: transparent;
      border: 0;
    }
  }

  code {
    padding: 0.2em;
    font-size: 85%;
    margin: 0;
    background-color: var(--colors-gray-200);
    border-radius: 4px;
  }
}