Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_code.scss « components « scss « src - github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 265ba03ebb5099ce8b4c51d255b6381fb83c7a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// Highlight code block
figure.highlight,
.codeblock {
    margin:         10px 0;
    line-height:    map-get($highlight, line-height);
    padding-top:    15px;
    padding-bottom: 15px;
    overflow:       hidden;

    table {
        display: block;
        width:   100%;
    }

    // Reset for tag `pre` and  for class `.gutter`, `.code`, `.tag`
    pre,
    .gutter,
    .code,
    .tag {
        background-color: inherit;
        font-family:      #{map-get($font-families, 'highlight')};
        border:           none;
        padding:          0;
        margin:           0;
        // To override cursor attribute of `.tag` components
        cursor:           text;
    }
    // To align line number and line of code regardless if there is a scroll bar or not
    .gutter,
    .code {
        vertical-align: top;
    }
    // hide gutter when code is plain text
    &.plain {
        .gutter {
            display: none;
        }
    }
    // Meta bar which contains name of the file and his link
    figcaption {
        font-size: 1.3rem;
        padding:   0 15px 20px;
        margin:    0;

        a {
            float: right;
        }
    }

    // Gutter which contains line numbers
    .gutter {
        border-right: map-get($highlight, border);
        padding:      0.3em 15px;
        line-height:    map-get($highlight, line-height);
        font-size:      map-get($highlight, font-size);

        pre {
            color: #aaaaaa;
        }
    }
    // Code container
    .code {
        padding: 0.3em 15px 0.3em 1em;
        width:   100%;

        pre {
            line-height:    map-get($highlight, line-height);
            font-size:      map-get($highlight, font-size);
            max-width:  calc(#{map-get($main-content, 'max-width')} - 50px);
            overflow-x: auto;
            overflow-y: hidden;
        }
    }
    // All lines in gutter and code container
    .line {
        height:    map-get($highlight, line-height);
        font-size: map-get($highlight, font-size);
    }
}

// Tabbed code block
.codeblock--tabbed {
    figure.highlight,
    pre > code {
        margin-bottom:  0;
        padding-bottom: 0;
    }
    figcaption {
        a, span {
            float: left !important;
        }
        .tabs {
            float: right;
            .tab {
                cursor:  pointer;
                display: inline-block;
                margin:  0 5px;
                padding: 0 7px;
                &:last-child {
                    margin-right: 0;
                }
            }
        }
    }
}

// Gist
.gist {
    .line,
    .line-number {
        font-family: map-get($font-families, 'highlight');
        font-size:   1em;
        margin:      0 0 5px 0;
    }
}