svelte-algolia
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -5,3 +5,3 @@ { | ||
"author": "Janosh Riebesell <janosh.riebesell@gmail.com>", | ||
"homepage": "https://github.com/janosh/svelte-algolia#readme", | ||
"homepage": "https://svelte-algolia.netlify.app", | ||
"repository": "https://github.com/janosh/svelte-algolia", | ||
@@ -12,3 +12,3 @@ "bugs": { | ||
"license": "MIT", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"type": "module", | ||
@@ -30,4 +30,6 @@ "svelte": "src/Search.svelte", | ||
], | ||
"dependencies": { | ||
"algoliasearch": "^4.9.1" | ||
}, | ||
"devDependencies": { | ||
"algoliasearch": "^4.9.1", | ||
"ava": "^3.15.0", | ||
@@ -34,0 +36,0 @@ "svelte": "^3.38.2" |
@@ -23,3 +23,3 @@ <p align="center"> | ||
Install with `yarn` or `(p)npm` | ||
Install with `yarn` | ||
@@ -30,2 +30,4 @@ ```sh | ||
or `(p)npm` | ||
```sh | ||
@@ -168,2 +170,45 @@ npm i -D svelte-algolia | ||
#### Styling | ||
`Search.svelte` offers the following CSS variables that can be [passed in directly as props](https://github.com/sveltejs/rfcs/pull/13): | ||
- `var(--iconColor)` | ||
- `var(--headingColor)` | ||
- `var(--inputBg)` | ||
- `var(--inputColor)` | ||
- `var(--hitsBgColor, white)` | ||
- `var(--hitsShadow, 0 0 2pt black)` | ||
For example: | ||
```svelte | ||
<Search | ||
indices={{ Pages: SearchHit, Posts: SearchHit }} | ||
{appId} {searchKey} | ||
--hitsBgColor="var(--bodyBg)" | ||
--inputColor="var(--textColor)" | ||
--iconColor="var(--linkColor)" /> | ||
``` | ||
The top level element is an `aside` with class `svelte-algolia`. So you can also style the entire DOM tree below it by defining global styles like | ||
```css | ||
:global(aside.svelte-algolia input button svg) { | ||
/* this would target the search icon */ | ||
} | ||
:global(aside.svelte-algolia div.results section h2) { | ||
/* this would target the heading shown above the list of results for each index */ | ||
} | ||
``` | ||
## Examples | ||
Some sites using `svelte-algolia` in production: | ||
- [`studenten-bilden-schueler.de`](https://studenten-bilden-schueler.de) [[code](https://github.com/sbsev/svelte-site)] | ||
- [`afara.foundation`](https://afara.foundation) [[code](https://github.com/janosh/afara)] | ||
- [`ocean-artup.eu`](https://ocean-artup.eu) [[code](https://github.com/janosh/ocean-artup)] | ||
Using `svelte-algolia` yourself? [Submit a PR](https://github.com/janosh/svelte-algolia/pulls) to add your site here! | ||
## Want to contribute? | ||
@@ -178,3 +223,3 @@ | ||
cd svelte-algolia/site | ||
sed -i '' 's/name: `Pokedex`/name: `Pokedex Clone`/' site/svelte.config.js | ||
sed -i.bak 's/name: `Pokedex`/name: `Pokedex Clone`/' site/svelte.config.js | ||
yarn | ||
@@ -181,0 +226,0 @@ yarn dev |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106604
2
226
1
2
+ Addedalgoliasearch@^4.9.1
+ Added@algolia/cache-browser-local-storage@4.24.0(transitive)
+ Added@algolia/cache-common@4.24.0(transitive)
+ Added@algolia/cache-in-memory@4.24.0(transitive)
+ Added@algolia/client-account@4.24.0(transitive)
+ Added@algolia/client-analytics@4.24.0(transitive)
+ Added@algolia/client-common@4.24.0(transitive)
+ Added@algolia/client-personalization@4.24.0(transitive)
+ Added@algolia/client-search@4.24.0(transitive)
+ Added@algolia/logger-common@4.24.0(transitive)
+ Added@algolia/logger-console@4.24.0(transitive)
+ Added@algolia/recommend@4.24.0(transitive)
+ Added@algolia/requester-browser-xhr@4.24.0(transitive)
+ Added@algolia/requester-common@4.24.0(transitive)
+ Added@algolia/requester-node-http@4.24.0(transitive)
+ Added@algolia/transporter@4.24.0(transitive)
+ Addedalgoliasearch@4.24.0(transitive)