Git Product home page Git Product logo

Comments (9)

ptbrowne avatar ptbrowne commented on June 2, 2024

Related : webpack-contrib/stylus-loader#163 (comment)

" Like the old quoted comment, I think its best to use stylus's json function to import variables from a json file that can easily be shared with js and other systems."

palette.styl could use the json function from stylus

http://stylus-lang.com/docs/bifs.html#jsonpath-options

from cozy-ui.

kosssi avatar kosssi commented on June 2, 2024

Je vote pour le 3

from cozy-ui.

gregorylegarec avatar gregorylegarec commented on June 2, 2024

Au sein de <Icon />, comment est ensuite gérée cette couleur ?

from cozy-ui.

ptbrowne avatar ptbrowne commented on June 2, 2024
import palette from 'cozy-ui/palette.json'

<Icon color={ palette['dodger-blue']} />

from cozy-ui.

y-lohse avatar y-lohse commented on June 2, 2024

De notre côté, on n'utilise pas les couleurs sous forme de variable js à ma connaissance. Ceci dit la solution 3 semble effectivement la plus pertinente.

from cozy-ui.

GoOz avatar GoOz commented on June 2, 2024

Ah putain, je savais même pas que Stylus traitait du json comme ça. Bref du coup, la 3 me convient très bien.

from cozy-ui.

CPatchane avatar CPatchane commented on June 2, 2024

Would it be possible to also expose all palette colors as css variable? It will avoid to do this kind of trick when we don't want to use stylus : https://github.com/cozy/cozy-store/blob/master/src/styles/palette.styl

from cozy-ui.

kosssi avatar kosssi commented on June 2, 2024

Voici un exemple sur cozy-bank : https://gitlab.cozycloud.cc/labs/cozy-bank/commit/d48a6a3ae09eba4926fb4599f12f36711fa8b5ca

from cozy-ui.

ptbrowne avatar ptbrowne commented on June 2, 2024

@CPatchane : please open another issue for this :) I will do the JSON trick and have a PR soon :)

from cozy-ui.

Related Issues (20)

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.