Skip to content

Commit

Permalink
feat(docsearch): introduce DocSearch.js v3 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Jul 9, 2020
0 parents commit 86a6a5d
Show file tree
Hide file tree
Showing 4 changed files with 787 additions and 0 deletions.
25 changes: 25 additions & 0 deletions package.json
@@ -0,0 +1,25 @@
{
"name": "@docsearch/css",
"version": "1.0.0-alpha.21",
"license": "MIT",
"homepage": "https://github.com/algolia/autocomplete.js",
"repository": "algolia/autocomplete.js",
"author": {
"name": "Algolia, Inc.",
"url": "https://www.algolia.com"
},
"sideEffects": false,
"files": [
"dist/"
],
"main": "dist/style.css",
"unpkg": "dist/style.css",
"jsdelivr": "dist/style.css",
"scripts": {
"build": "yarn build:clean && yarn build:css",
"build:css": "mkdir dist && cp src/_variables.css dist/ && cp src/modal.css dist/ && cp src/search-button.css dist/ && cat src/*.css > dist/style.css",
"build:css:watch": "chokidar src/*.css --command \"yarn build:css\"",
"build:clean": "rm -rf ./dist",
"watch": "concurrently \"yarn build:css:watch\""
}
}
74 changes: 74 additions & 0 deletions src/_variables.css
@@ -0,0 +1,74 @@
/* Variables */

:root {
--docsearch-primary-color: rgb(84, 104, 255);
--docsearch-text-color: rgb(28, 30, 33);
--docsearch-spacing: 12px;
--docsearch-icon-stroke-width: 1.4;
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-muted-color: rgb(150, 159, 175);
--docsearch-container-background: rgba(101, 108, 133, 0.8);
--docsearch-logo-color: rgba(84, 104, 255);

/* modal */
--docsearch-modal-width: 560px;
--docsearch-modal-height: 600px;
--docsearch-modal-background: rgb(245, 246, 247);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.5),
0 3px 8px 0 rgba(85, 90, 100, 1);

/* searchbox */
--docsearch-searchbox-height: 56px;
--docsearch-searchbox-background: rgb(235, 237, 240);
--docsearch-searchbox-focus-background: #fff;
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);

/* hit */
--docsearch-hit-height: 56px;
--docsearch-hit-color: rgb(68, 73, 80);
--docsearch-hit-active-color: #fff;
--docsearch-hit-background: #fff;
--docsearch-hit-shadow: 0 1px 3px 0 rgb(212, 217, 225);

/* key */
--docsearch-key-gradient: linear-gradient(
-225deg,
rgb(213, 219, 228) 0%,
rgb(248, 248, 248) 100%
);
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230),
inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4);

/* footer */
--docsearch-footer-height: 44px;
--docsearch-footer-background: #fff;
--docsearch-footer-shadow: 0 -1px 0 0 rgb(224, 227, 232),
0 -3px 6px 0 rgba(69, 98, 155, 0.12);
}

/* Darkmode */

html[data-theme='dark'] {
--docsearch-text-color: rgb(245, 246, 247);
--docsearch-container-background: rgba(9, 10, 17, 0.8);
--docsearch-modal-background: rgb(21, 23, 42);
--docsearch-modal-shadow: inset 1px 1px 0 0 rgb(44, 46, 64),
0 3px 8px 0 rgb(0, 3, 9);
--docsearch-searchbox-background: rgb(9, 10, 17);
--docsearch-searchbox-focus-background: #000;
--docsearch-hit-color: rgb(190, 195, 201);
--docsearch-hit-shadow: none;
--docsearch-hit-background: rgb(9, 10, 17);
--docsearch-key-gradient: linear-gradient(
-26.5deg,
rgb(86, 88, 114) 0%,
rgb(49, 53, 91) 100%
);
--docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85),
inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3);
--docsearch-footer-background: rgb(30, 33, 54);
--docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
0 -4px 8px 0 rgba(0, 0, 0, 0.2);
--docsearch-logo-color: rgb(255, 255, 255);
--docsearch-muted-color: rgb(127, 132, 151);
}

0 comments on commit 86a6a5d

Please sign in to comment.