.content {
    code {
        @apply .m-0 .text-sm .border .border-grey-light .bg-grey-lighter .rounded;
        padding: .15rem .4rem;
    }

    pre, pre[class*="language-"] {
        @apply .leading-normal .overflow-auto .my-4 .mx-0;

        code {
            @apply .text-white .p-0 .bg-transparent .border-0 .inline-block;
        }

        &::-webkit-scrollbar {
            @apply .bg-transparent .h-2;
        }
        &::-webkit-scrollbar-thumb {
            @apply .bg-grey-darker .rounded;

            &:hover {
                @apply .bg-grey-dark;
            }
        }
    }
}

div[class*="language-"] {
    @apply .relative .bg-grey-darkest .rounded .border .border-black .text-sm .my-4;

    .highlight-lines {
        @apply .absolute .left-0 .w-full .leading-normal .select-none;
        top: .9rem;

        .highlighted {
            background: rgba(0, 0, 0, 0.3);
        }
    }

    pre, pre[class*="language-"] {
        @apply .bg-transparent .relative .m-0;
        z-index: 1;
    }

    &::before {
        @apply .absolute .text-xs .text-grey;
        top: 1em;
        right: 1em;
    }

    &:not(.line-numbers-mode) {
        .line-numbers-wrapper {
            @apply .hidden;
        }
    }
    &.line-numbers-mode {
        .highlight-lines .highlighted {
            @apply .relative;

            &:before {
                @apply .absolute .left-0 .top-0 .block .h-full .w-4;
                content: ' ';
            }
        }

        pre {
            @apply .align-middle .w-4;
        }

        .line-numbers-wrapper {
            @apply .absolute .top-0 .text-center .w-4;

            br {
                @apply .select-none;
            }

            .line-number {
                @apply .relative .select-none;
            }
        }
        &::after {
            @apply .absolute .top-0 .left-0 .h-full .w-4;
            content: '';
        }
    }
}

/* language hints */

@each $lang in js,ts,html,md,vue,css,sass,scss,less,stylus,go,java,c,sh,yaml,conf,sql {
    div[class~="language-#{$lang}"]:before {
        content: '#{$lang}';
    }
}

div[class~="language-javascript"]:before {
    content: "js";
}
div[class~="language-typescript"]:before {
    content: "ts";
}
div[class~="language-markup"]:before {
    content: "html";
}
div[class~="language-markdown"]:before {
    content: "md";
}
div[class~="language-json"]:before {
    content: "json";
}
div[class~="language-ruby"]:before {
    content: "rb";
}
div[class~="language-python"]:before {
    content: "py";
}
div[class~="language-bash"]:before {
    content: "sh";
}
