-
Notifications
You must be signed in to change notification settings - Fork 12
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
Theme architecture #104
Comments
That's a very good start, @oleq. Well done! I would be very focused on creating some "base abstract components" to support (kinda) inheritance from the main components. Maybe that's what you meant with "base-box". Just want to be sure that we'll have things like "base-box" (or "inline-box"), "container-box", "floating-box", etc. This means that almost all components will inherit from one of the "base" ones. Then when it comes to naming, will the ".base" classes endup in the final CSS? Hopefully not as they're not really useful. Otherwise we'll need to prefix them with ".cke" as well. It's not specified that custom themes will be able to inherit from other themes (specially the "default" one). I would make it clear because this will be one of the easiest ways to create custom themes, based on existing ones (overriding rules, for example). It would be great to understand how optimized the final CSS would look in this case, for example whether overiden rules will not get there twice (the original and the override). |
Some minor and OT things:
Other than that, big +1. [1] A long time ago we discussed that CKEditor should not be loading its CSS automatically because it's super irritating when your website uses an asset pipeline. We agreed that there will be nothing bad in requiring that a developer includes a CSS file manually. However, it can work this way in the production mode, but in dev mode we can have an automated loader or an index file which will import all CSS files which the builder produced. One more thing – I favour multiple CSS files in the dev workflow because the watcher (builder) does not have to rewrite so much code every time some source file has changed. |
Could you maybe give the end developer the option in the production build? Perhaps it could be as simple as optionally including a "plugin" (or the CKE5 equivalent) that auto-loads the CSS. |
BTW, I know you avoid any jQuery dependencies, but I really like the jQuery UI Theme Roller approach. I like being able to build my own theme that integrates well stylistically with my web app. A default theme is useful and necessary, but allowing simple generation (via a separate builder web app) of new themes would be huge help. |
Yes, CKE5 will not depend on jQuery but I got you point about theme customisation. I know only too well how hard could it be. And I think the answer, though not as pretty and intuitive as Theme Roller, will be the CSS preprocessor. With just a few changes to the variables, developers will be able to change the main colors, fonts, paddings, etc. of the entire UI. And given that Chrome is capable of reloading CSS live from, let's say, Less, it gets quite easy for people to customise the editor. |
Hm... sounds interesting. This may be the best solution. |
+1 |
Cleaning up old discussions. See #186. |
Idea
The idea is that CSS in CKEditor 5 will come from three separate sources:
Implementation
.less
files into a single CSS file.button.less
, but its JS does not refer tobutton.js
. In fact,button.js
may not be used at all, so thebutton.less
. A 3rd party component would need to explicitly inform the builder that it needs corebutton.less
.package.json
.Related issues
The text was updated successfully, but these errors were encountered: