Coder Social home page Coder Social logo

kaisermann / svelte-css-vars Goto Github PK

View Code? Open in Web Editor NEW
235.0 7.0 3.0 1.4 MB

:sparkles: Ever wanted to have reactive css variables in svelte? What if I told you there's a way?

License: MIT License

JavaScript 50.80% CSS 19.61% HTML 8.14% Svelte 21.45%
svelte css custom-properties css-variables reactive state

svelte-css-vars's Issues

Missing /dist directory when installing with npm from github

The issue

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.

Proposed solution

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.

Add Typescript definitions

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;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.