re-com
re-com copied to clipboard
Feature request: re-com sans class
Hi, thanks for re-com, it is really useful and it's a great ready-made component library for re-frame.
I have a feature request: it would be nice to be able to pass in a property to the various re-com components which would cause them not to emit any style or class tags, so that they'd be a little easier to plug into a site which already had an existing CSS framework. I'm specifically thinking of the text-input
component - I'd like to use some of its behavioral properties without having to untangle the intersection of the re-com CSS and the CSS library I've already got on the site I'm working on (to wit, materializecss, which you'd think would be a good match but for some reason getting the spacing and whatnot correct is a little painful).
I think re-com's default should still be to include class tags in its emitted hiccup which correspond to its bundled CSS, I just want an escape hatch available (if I'm reading the docs and code correctly, currently I can add CSS classes but I can't remove them), at least in components where it makes sense. I wouldn't necessarily expect more complex components like the date-picker to have this, but it would be nice for stuff like the input-text and input-textarea components.
Hmm. So I can see what you are after.
So the goal here would be:
- to be able to supply a
:style
or:class
AND - indicate that this style/class should not be merged with the standard styles/classes and, instead, should be taken as the complete style/class in its own right?
In fact, sometimes, just supply a :class
and NOT even supply a :style
but have the standard :style
ignored. And visa versa.
Yes, that's precisely it. Maybe the parameter could be named :override-style
or :override-class
? As a degenerate case, supplying an empty string as the parameter should cause no :style
or :class
attribute (respectively) to be emitted at all.
I recognize I'm working in kind of an edge case here, so I don't have any problem specifying both :override-class ""
and :override-style ""
if I need to drop the style and class stuff altogether (as opposed to needing some funky logic where an empty :override-style
implies an empty :override-class
or the other way around).
Maybe a better design would have been to name the initial parameter :add-classes
, not :class
; same thing for styles. But of course this would be a breaking change.
Has this feature been implemented?
Also, is it possible to specify an :id
to element?