-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Feature split: which part of a feature should import content style CSS file? #974
Comments
I think that CSS is related to the editing more than to the UI. One could create an editor with their custom UI and use our default content styles (like the font or highlight styles). That makes sense. OTOH, that kind of CSS is irrelevant when they create a headless editor. E.g. on the server-side. They could probably filter all the CSS out at the Webpack stage but still the CSS imports in So it gives us 2 options:
What are the drawbacks of 1.? cc @Reinmar |
@oleq I'd rather see them in Editing and be filtered out by webpack for headless. What if someone use Editing + UI without a main feature? Or use different UI (like heading buttons) with existing editing? |
I wouldn't be mad if those styles would in in Editing. |
Hm. A good point. OTOH, why not use our glue feature class in this case?
They could use the same |
If the editing part of the feature would import these CSS files, then we would lose Node.js compatibility. We tested some time ago that you can run CKEditor 5's source in Node.js without building it. We didn't run the whole editor, but I expect that unless you import any SVG or CSS files, that should be possible. However, it's only possible as long as we keep the strict UI vs Editing separation. I checked now that SVG and CSS files are mainly imported by UI modules. There are two exceptions:
So, theoretically, if not for cases like widgets (where we have a UI inlined in the editing area), it would be easy. The only thing which would bother me is that the UI modules deal with UI of the features. While content styles are not part of that. So I could agree to import them in the However, styles and SVGs used directly in the editing area are more tricky. I'm quite sure that we could come up with a way to split the code of e.g. the To sum up:
|
Ah yes - it's a blocker for importing CSS/SVG's there. Right now I can't think about anything else then extracting some sort of Also I agree that Node.js compatibility and/or headless editor is more important then how to organize the code. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
So we did a feature split (#488) some time ago which created
FeatureEditing
andFeatureUI
parts for some generalFeature
.The thing that bothers me is whether content styles (to be precise: styles for markup in the editor not the UI elements) should be imported by
FeatureUI
or byEditingUI
.The examples are:
If you import for instance
HighlightEditing
only and you'd like to create own UI the content styles defined by configuration (colors of highlighters) will not be created asHighlightUI
imports css file?As such I'm leaning towards that we should move those content styles imports to editing part of a feature as those are tied to editing part of a feature.
Side note: I have some problems with defining whether Widget is UI part or Editing part of the editor. The Widget plugin itself has no Editing nor UI parts extracted. But as long it operates on editable content I think that it is an Editing stuff. So if some feature modifies styles for widget (Table) those styles should be imported by it Editing part.
The text was updated successfully, but these errors were encountered: