@import '../00_Abstracts/index';

pre,
code,
kbd,
samp {
    @include font(monospace);
    @include font-size(sm); // Correct the odd `em` font sizing in all browsers.
}

// 1. Remove browser default top margin
// 2. Reset browser default of `1em` to use `rem`s
// 3. Don't allow content to break outside
pre {
    display: block;
    overflow: auto; // 3
    font-size: inherit;
    @include mt(none); // 1
    @include mb(lg); // 2

    // Account for some code outputs that place code tags in pre tags
    code {
        font-size: inherit;
        color: inherit;
        word-break: normal;
    }
}

code {
    word-wrap: break-word;

    // Streamline the style when inside anchors to avoid broken underline and more
    a > & {
        color: inherit;
    }
}

kbd {
    @include p(sm);
    @include font-size(xs);
    color: text-color(dark);
    background-color: color(dark);
    @include br(sm);

    kbd {
        padding: 0;
        @include font-size(xs);
    }
}
