Skip to content

Commit

Permalink
chore(plugin-search): convert style to scss
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Feb 2, 2024
1 parent 498b329 commit af2e351
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 101 deletions.
3 changes: 2 additions & 1 deletion plugins/plugin-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "rimraf --glob ./lib ./*.tsbuildinfo",
"copy": "cpx \"src/**/*.{d.ts,css,svg}\" lib"
"copy": "cpx \"src/**/*.{d.ts,svg}\" lib",
"style": "sass src:lib --style=compressed --no-source-map"
},
"dependencies": {
"chokidar": "^3.5.3",
Expand Down
100 changes: 0 additions & 100 deletions plugins/plugin-search/src/client/styles/search.css

This file was deleted.

96 changes: 96 additions & 0 deletions plugins/plugin-search/src/client/styles/search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
.search-box {
display: inline-block;
position: relative;
margin-left: 1rem;

@media print {
display: none;
}

input {
-webkit-appearance: none;
appearance: none;
cursor: text;
width: var(--search-input-width);
height: 2rem;
color: var(--search-text-color);
display: inline-block;
border: 1px solid var(--search-border-color);
border-radius: 2rem;
font-size: 0.9rem;
line-height: 2rem;
padding: 0 0.5rem 0 2rem;
outline: none;
transition: all ease 0.3s;
background: var(--search-bg-color) url('search.svg') 0.6rem 0.5rem no-repeat;
background-size: 1rem;

@media (max-width: 719px) {
cursor: pointer;
width: 0;
border-color: transparent;
position: relative;
}

&:focus {
cursor: auto;
border-color: var(--search-accent-color);

@media (max-width: 719px) {
cursor: text;
left: 0;
width: 10rem;
}

@media (max-width: 419px) {
width: 8rem;
}
}
}

.suggestions {
background: var(--search-bg-color);
width: var(--search-result-width);
position: absolute;
top: 2rem;
right: 0;
border: 1px solid var(--search-border-color);
border-radius: 6px;
padding: 0.4rem;
list-style-type: none;

@media (max-width: 419px) {
width: calc(100vw - 4rem);
right: -0.5rem;
}
}

.suggestion {
line-height: 1.4;
padding: 0.4rem 0.6rem;
border-radius: 4px;
cursor: pointer;

a {
white-space: normal;
color: var(--search-item-text-color);
}

&.focus {
background-color: var(--search-item-focus-bg-color);

a {
color: var(--search-accent-color);
}
}

.page-title {
font-weight: 600;
}

.page-header {
font-size: 0.9em;
margin-left: 0.25em;
}
}
}

0 comments on commit af2e351

Please sign in to comment.