coderedcorp / coderedcms

Wagtail + CodeRed Extensions enabling rapid development of marketing-focused websites.
https://www.coderedcorp.com/cms
Other
685 stars 133 forks source link

Curated Tag List for Styles #376

Open thenewguy opened 3 years ago

thenewguy commented 3 years ago

It would be helpful if the tags input was a curated tag list. Could be controlled with django taggit and a snippet model. Ideally preloaded with bootstrap style classes

vsalvino commented 3 years ago

This is a good idea, but would be really difficult to implement. You'd have to somehow parse all of the site's CSS, most likely as part of the deployment process, to determine which CSS class names are available to be suggested in the field. I don't think it would be practical to implement, but many people have brought it up as an idea.

I think a better approach would be to move away from relying on custom CSS classes, and add fields for common properties such as alignment, color, position, etc. And to improve the custom template experience for developers.

thenewguy commented 3 years ago

It would be up to the editors to add the tags for "custom" css. They would be addable from the snippet model.

Like this: https://docs.wagtail.io/en/v2.11.1/reference/pages/model_recipes.html?highlight=tag#disabling-free-tagging

What I meant for the "default" would be bootstrap's default tags. Like text-center, m-3, p-3, etc that are common among all bootstrap sites

-- Edit --

The benefit would be documenting available tags and also autocomplete from the tag widget

thenewguy commented 3 years ago

I agree it would be nice to have some clicky options for common things on certain blocks - like centered text - but the custom css classes is pretty powerful. I would hate to see it go as it would take a tremendous number of clickies to replace all of the options. This handles a nice catch-all for those few blocks that need to be different