summaryrefslogtreecommitdiff
path: root/sysret.org/themes/tabi-lean/sass/parts/_search.scss
blob: df820e4954edd7b47ae621cf14e0dfac77881af0 (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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
$icon-size: 1.3rem;

#searchModal {
    background: color-mix(in srgb, var(--primary-color) 5%, transparent);
    text-align: start;

    #searchContainer {
        padding: 1rem;
    }

    #searchBar {
        display: flex;
        position: relative;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        padding: 1rem;

        .search-icon {
            position: absolute;
            inset-inline-start: 1rem;
            width: $icon-size;
            height: $icon-size;

            path {
                fill: var(--text-color);
            }
        }

        .close-icon {
            display: none;
            position: absolute;
            right: $icon-size;
            margin-inline-start: 1rem;
            margin-inline-end: 0.5rem;
            width: $icon-size;
            height: $icon-size;
        }

        #searchInput {
            flex: 1;
            border: 1px solid var(--divider-color);
            border-radius: 20px;
            background-color: var(--input-background-color);
            padding-inline: 3rem 1rem;
            padding-block: 0.75rem;
            width: calc(100% - 2rem);
            color: var(--text-color);
            font-size: 1rem;
        }
    }

    #results-container {
        display: none;
        border-top: var(--divider-color) solid 0.5px;
        border-bottom-right-radius: 1rem;
        border-bottom-left-radius: 1rem;
        overflow: hidden;

        #results-info {
            padding: 0.5rem;
            color: var(--meta-color);
            font-size: 0.8rem;
            text-align: center;
        }

        #results {
            display: flex;
            flex-direction: column;
            max-height: 50vh;
            overflow-y: auto;

            b {
                font-weight: 590;
            }

            a {
                display: block;

                &:hover {
                    background-color: inherit;
                }
            }

            > div {
                cursor: pointer;
                padding-inline: 1rem;
                padding-block: 0.5rem;

                &[aria-selected="true"] {
                    background-color: var(--primary-color);
                    color: var(--hover-color);

                    a,
                    span {
                        color: inherit;
                    }
                }
            }

            span:first-child {
                display: block;
                color: var(--primary-color);
                font-weight: 590;
            }

            span:nth-child(2) {
                color: var(--text-color);
            }
        }

    }
}

.search-icon {
    display: block;
    position: relative;
    align-self: center;
    margin-inline-start: 1rem;
    margin-inline-end: 0.5rem;
    width: $icon-size;
    height: $icon-size;
}

.search-modal {
    -webkit-backdrop-filter: blur(8px);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 100%;
    overflow: auto;

    #modal-content {
        position: relative;
        margin: 8% auto;
        border: var(--divider-color) solid 0.5px;
        border-radius: 1rem;
        background-color: var(--background-color);
        width: 80%;
        max-width: 28rem;
    }
}

@media only screen and (max-width: 600px) {
    .search-modal {
        #modal-content {
            top: 3.5rem;
            width: 92%;

            #results {
                max-height: 70vh;
            }
        }
    }
}