django-pattern-library
django-pattern-library copied to clipboard
Add ability to override resize sizes
Is your proposal related to a problem?
Right now the sizes used for different breakpoints (S, M and L) are fixed values. They are defined in https://github.com/torchbox/django-pattern-library/blob/main/pattern_library/templates/pattern_library/index.html#L16. Not all projects uses the same breakpoints. There are some scenarios where having other values would make more sense to review the components
Describe the solution you'd like
Add the ability to override the values defined in https://github.com/torchbox/django-pattern-library/blob/main/pattern_library/templates/pattern_library/index.html#L16. Those can be the default values, but it would be great to have a settings variable that could allow us to override those values
It's possible to override these values by overriding this entire template (https://docs.djangoproject.com/en/4.2/howto/overriding-templates/) which I have done in a project. If more settings aren't wanted for the pattern library it might be nice to put the resize buttons in a block which could extend/override (https://docs.djangoproject.com/en/4.2/howto/overriding-templates/#extending-an-overridden-template) just that one block.
I like the idea 👍 a setting seems sensible to me. Something like:
PATTERN_LIBRARY = {
"VIEWPORTS": {
"S": { "width": 320 },
"M": { "width": 640 },
},
}