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

Material design compatibility #44

Closed
mattboldt opened this issue Jun 17, 2018 · 12 comments
Closed

Material design compatibility #44

mattboldt opened this issue Jun 17, 2018 · 12 comments

Comments

@mattboldt
Copy link

Hi! I’d like the contribute by adding a material design template. Is this something you’d be interested in adding?

@ddnexus
Copy link
Owner

ddnexus commented Jun 17, 2018

Yes! Your contribution is very welcome!

It would be nice if you could add some more details about what and how you plan to add, in order to match the overall policy about extras.

Please let me know if you need any help. Thank you!

@mattboldt
Copy link
Author

I was thinking of implementing these:

https://getmdl.io/
https://materializecss.com/

I personally use mdl, but I bet people would like to have a few out of the box to make a transition to pagy easier.

I noticed you've got helper methods for bootstrap as well as partials. Any reason for not using one or the other?

@ddnexus
Copy link
Owner

ddnexus commented Jun 17, 2018

Helpers are just concatenating strings with a simple logic in pure ruby with no framework dependencies. They are really fast, but less easy to read and write.

Templates use a template engine, hence they have an overhead that makes them 40-80% slower than helpers. That means that they are still a lot faster than using the other gems, but they are slower and use more memory than helpers. They are easier to read and write, which makes them useful for unskilled users that need some quick and easy customization.

For that reason you might want to provide both in your extra, although helpers are a mandatory component for an extra, while templates are just a nice addition.

@ddnexus
Copy link
Owner

ddnexus commented Jun 23, 2018

@mattboldt Any progress? Please, let me know if I can help. Thanks.

@mattboldt
Copy link
Author

Sorry; I'm stumbling a little bit on the code. Our styles are very different and it's been difficult to try and match the existing extras. On top of that, the MDL library does not already have a pagination component. I might start with Materializecss instead.

@ddnexus
Copy link
Owner

ddnexus commented Jun 25, 2018

Unless I am missing something, that looks quite easy.

According to the materializecss pagination doc, you should just duplicate and rename the bootstrap extra like materializecss extra, then rename the pagy_nav_bootstrap to pagy_nav_materializecss and edit its strings as indicated in the materializecss pagination doc.

Replace the bootstrap-specific classes (like page-link and page-item) with the materializecss classes and leave all the rest as it is, wrapped in the nav tag.

Please, let me know if you need any help. Thanks.

@mattboldt
Copy link
Author

Right, materialize has pagination built in. MDL does not. The former will be easy to add, so I’ll do that for now.

@ddnexus
Copy link
Owner

ddnexus commented Jun 25, 2018

Great! Thanks!

@ddnexus
Copy link
Owner

ddnexus commented Jul 9, 2018

@mattboldt News?

@ddnexus ddnexus added the WIP label Jul 16, 2018
@ddnexus
Copy link
Owner

ddnexus commented Jul 16, 2018

After no activity for so long I decided to write it myself.

@mattboldt
Copy link
Author

Really sorry, I just haven't had time for dev work outside of my day job. Sorry for holding this up, and thank you for adding the feature!

ddnexus added a commit that referenced this issue Jul 17, 2018
@ddnexus ddnexus added implemented and removed WIP labels Jul 17, 2018
@ddnexus
Copy link
Owner

ddnexus commented Jul 17, 2018

Implemented in dev. No optional templates though... it would be a nice addition when someone will have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants