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

[WIP] Allow external usage of individual components. #1

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

thet
Copy link
Member

@thet thet commented Apr 8, 2021

This is a proof of concept and work in progress.

The idea is to allow individual components to be usable outside this repository and not need to build/import the whole CSS bundle.
I want to individually use the CSS here in individual patterns and only if they are loaded by importing these files in JavaScript. For example like in this commit: Patternslib/Patterns@2cde595
Note this is optional and these JavaScript imports can be easily turned off (as we will be the case for ploneintranet.prototype and others without any further changes in these integration packages).

For this to achieve I have to make some adaptions.

  • I did split up the _patterns.scss and moved out the generic styles into a _common.scss which can be imported by individual components. The scss compiler should be smart enough to not multiply include the same output from _common.scss in the built bundle.
  • I would need fontello to be available. I found out that there is no maintained npm package which I could just import and use. AFAIK this wouldn't be easily possible anyways as fontello can be configured to only include icons which we want to use. However, usage of fonts is discouraged AFAIK. I'd love to switch to SVG icons. In Plone 6 we're using the SVG icons from https://icons.getbootstrap.com/

Due to a number of open and debatable questions it's probably faster to reach the goal of a downloadable Patternslib bundle if we just build the whole CSS and offer it for download. Which is probably huge, but we can improve later and eventually build on the ideas outlined above.

Some questions to @cornae:

  • Can you build such a downloadable CSS bundle which includes just everything?
  • What do you think on the ideas outlined above?
  • Would it be much effort to switch to SVG icons?

Related:

@thet thet requested a review from cornae April 8, 2021 18:44
@thet thet marked this pull request as draft April 8, 2021 18:44
@cornae
Copy link
Member

cornae commented Apr 8, 2021

@thet You raise some ideas and questions that are so big that I cannot possibly answer them here, nor can I oversee the consequences. Do you want to set up a workshop of an afternoon or perhaps longer to discuss?

@thet
Copy link
Member Author

thet commented Apr 8, 2021

@cornae Yes, let's do that in accordance with @pilz
What about the CSS bundle? I probably can just get it from ploneintranet.prototype...?

@cornae
Copy link
Member

cornae commented Apr 8, 2021

The CSS bundle is work in progress. Whenever I have time I do a little bit. Recently I've made some improvements again and I hooked up another project to the centralised bundle to make it more robust. The fact that it's not ready is also the reason that I don't want to include CSS yet with the download on the patterns site.

@thet
Copy link
Member Author

thet commented Apr 8, 2021

Hm... I think we need at least some CSS.
But I can just JavaScript-import the CSS for external libraries like the date-picker, slick-slider, tooltips and so on.

@cornae
Copy link
Member

cornae commented Apr 8, 2021 via email

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

Successfully merging this pull request may close these issues.

2 participants