Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to override resize sizes #227

Open
jkevingutierrez opened this issue Jul 7, 2023 · 2 comments
Open

Add ability to override resize sizes #227

jkevingutierrez opened this issue Jul 7, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers ui Related to the user interface of the pattern library

Comments

@jkevingutierrez
Copy link
Contributor

jkevingutierrez commented Jul 7, 2023

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

@kmtracey
Copy link

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.

@thibaudcolas
Copy link
Member

I like the idea 👍 a setting seems sensible to me. Something like:

PATTERN_LIBRARY = {
    "VIEWPORTS": {
		"S": { "width": 320 },
		"M": { "width": 640 },
	},
}

@thibaudcolas thibaudcolas added enhancement New feature or request good first issue Good for newcomers ui Related to the user interface of the pattern library labels Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers ui Related to the user interface of the pattern library
Projects
None yet
Development

No branches or pull requests

3 participants