variantjs / core Goto Github PK
View Code? Open in Web Editor NEWVariantJS common functions and utilities
VariantJS common functions and utilities
From my point of view, some components have more configuration states than just variant. According to #8 multiple variants makes it too difficult to maintenance the classesList which I total agree.
Maybe a solution could be presets for each prop. I try to explain the idea based on this configuration example, and I created a small repository to demonstrate it as a working demo. Here is the link: https://github.com/christianwiedemann/variantjs-samples
Example:
export const theme: VariantJSConfiguration = {
'TButton': {
preset: {
size: {
large: 'p-20',
default: 'p-10'
},
color: {
primary: 'bg-blue-500',
secondary: 'bg-yellow-500'
},
},
variants: {
outline: {
preset: {
color: {
primary: 'border-blue-500',
secondary: 'border-yellow-500'
},
},
classes: {
default: 'border border-solid'
}
}
},
fixedClasses: {
default: 'btn'
},
}
}
What do you think?
While working on a PR I noticed that you used npm and yarn since both lock files are present. Which is your current preference?
Not sure if you already thought about it but I think it would help to create a mono repository to keep the overview (at least for the core, react and vue repositories). What do you think?
Is this still actively being worked on?
What do you think about passing multiple variants to a component? They could be separated by spaces (just like CSS classes) and then you could combine them as necessary, e.g. for a button: "icon sm", "primary lg" etc.
See discussion here #3
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.