kaisermann / svelte-css-vars Goto Github PK
View Code? Open in Web Editor NEW:sparkles: Ever wanted to have reactive css variables in svelte? What if I told you there's a way?
License: MIT License
:sparkles: Ever wanted to have reactive css variables in svelte? What if I told you there's a way?
License: MIT License
Using this module in a TypeScript project with "noImplicitAny": true
causes errors as there is no definitions file.
Please add a .d.ts file for this package. Here is my quick attempt at it that seems to resolve the issue:
declare module 'svelte-css-vars'
{
export function update(new_props: any);
function apply(node: HTMLElement, props: any);
export default apply;
}
@kaisermann I simply put your demo in a svelte REPL: https://svelte.dev/repl/685251e3c38e443abb47ba8e99171568?version=3.18.2
Could be useful to add to the README?
Hi,
I tired to install this package from github with npm (npm i --save https://github.com/kaisermann/svelte-css-vars
), but can't use it in my project. I get the following error:
'Failed to resolve entry for package "svelte-css-vars". The package may have incorrect main/module/exports specified in its package.json'
Looking at the folder inside node-modules
, the dist
folder is missing.
After some research, I found that adding the following script in pacakge.json
fixes the error.
"prepare": "npm run build"
When this script is added, npm automatically builds the package upon installation.
If you consider this a viable solution, I would gladly open a PR for it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.