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

Preserve all selectors in CSS files during split into editor and content stylesheets. #972

Conversation

pszczesniak
Copy link
Contributor

@pszczesniak pszczesniak commented Jul 10, 2024

Suggested merge commit message (convention)

Fix (build-tools): Should preserve all selectors and at-rules in CSS files during split into editor and content stylesheets. Closes ckeditor/ckeditor5#16703.


Additional information

The main problem was when we were splitting main css file into editor and content. Mainly it was done using .ck-content CSS class as a main target what should be put into content file and all the rest should land into editor. But this condition didn't include neither @media queries or animations with @keyframes that class contains.

Currently all @media queries are splitted by class name mention above.

The @keyframes are gathered from whole main css file; also all selectors that are containing animation or animation-name are gathered and compared in against selector that are used into. By this they can be correctly divided and added to desired css stylesheets.

Also some CSS classes were omitted when there were more than one selector in definition. It's also fixed in this PR.

@pszczesniak pszczesniak requested a review from filipsobol July 10, 2024 10:26
@coveralls
Copy link

coveralls commented Jul 10, 2024

Coverage Status

coverage: 90.684%. remained the same
when pulling 63f4c83 on unify-content-and-editor-stylesheets-with-one-included-all
into 3aa443b on master.

@pomek
Copy link
Member

pomek commented Jul 11, 2024

Could I ask you to explain what the problem was?

@pszczesniak pszczesniak marked this pull request as draft July 12, 2024 06:05
@pszczesniak
Copy link
Contributor Author

Could I ask you to explain what the problem was?

Will wrote an explanation when i finish the task, for now it's still WIP.

@pszczesniak pszczesniak marked this pull request as ready for review July 12, 2024 08:57
@pszczesniak
Copy link
Contributor Author

@pomek I've updated the additional information in PR description.

@pszczesniak pszczesniak requested a review from filipsobol July 12, 2024 08:59
/**
* CSS rule type which are supported by this plugin.
*/
const SUPPORTED_RULE_TYPES = [ 'rule', 'media', 'keyframes' ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now, but I worry that long-term we might miss other types.

@filipsobol
Copy link
Member

Work will continue in #979.

@filipsobol filipsobol closed this Jul 19, 2024
@filipsobol filipsobol deleted the unify-content-and-editor-stylesheets-with-one-included-all branch July 19, 2024 10:35
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.

Slightly visual differences between using ckeditor5.css and ckeditor5-editor.css with ckeditor5-content.css.
4 participants