question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: a class map for easy class manipulation.

See original GitHub issue

Describe the new feature you’d like Proposed solution for allowing classes to be overriden on any sub-element of vue-formulate:

The default would be something like:

Vue.use(VueFormulate, {
  classmap: context => ({
    "outer": `formulate-input`,
    "outer-wrapper": `formulate-input-wrapper`,
    "element-wrapper": `formulate-input-element formulate-input-element--${context.type}`,
    "element": '',
    "help": "formulate-input-help",
    "errors": "formulate-input-errors",
    "error": "formulate-input-error"
  })
}

The idea is that classMap function would be defined globally for all inputs, and then each sub-type could override it, and then as granular as individual input fields could also override each:

<FormulateInput
  type="text"
  classmap-element="form-input block w-full sm:text-sm sm:leading-5"
/>

The idea is that the above solution would allow a developer to setup their own fields using a class-based ui framework and handle 90% of a project’s form styles globally for all FormulateInput elements, and then on a case by case basis easily override the styles on a per-element basis, and lastly scoped slots as a nuclear option.

I’ll reiterate the goal of Vue Formulate is to make high quality form building fast and easy, so I we want to provide that 90% solution as painlessly as possible. 90% of inputs shouldn’t require any additional configuration, scoped slot usage, etc.

What percentage of vue-formulate users would benefit? Probably about 20%


I’m looking for feedback from users of frameworks like Tailwind, Tachyons, or Bootstrap.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:35 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
justin-schroedercommented, Jun 11, 2020

Hey @narwy @hmaesta and @gilesbutler — this feature is almost finished now. I’ve got an early preview of the docs here:

https://vueformulatecom-git-feature-classmaps.braid.now.sh/guide/theming/#customizing-classes

I think this should handle almost every use case, and like @narwy mentioned you can just configure your tailwind classes once at the global level and be done — then when you need a little more customization on a particular input extend those globals. Would love feedback though!

4reactions
Garitocommented, May 30, 2020

According with Linus Borg’s portal-vue: “A feature-rich Portal Plugin for Vuejs, for rendering DOM outside of a component, anywhere our app or the entire document.”

Bye

Read more comments on GitHub >

github_iconTop Results From Across the Web

A proposal to add a utility class to represent expected monad
Class template expected<T,E> proposed here is a type that may contain a value of type T or a value of type E in...
Read more >
Example of a class map. | Download Scientific Diagram
We propose to draw the so-called class map for each class g, which plots PAC(i) versus farness(i) for all objects i in g....
Read more >
Elementary Patterns: ChiliPlop 98 Hot Topic Proposal
We show students design patterns as part of a library of classes we provide and that students use in the first two courses....
Read more >
Bloom's Taxonomy Revised - CNM
Have students group up and perform simple experiments to the class showing how one of the laws of motion works. Use the following...
Read more >
GAMEPLAY AND GAME MECHANICS DESIGN - OECD
Below we propose a version of our heuristics which is simplified but still useful enough to serve as a guideline for game mechanics...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found