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

Table header content styles do not contain text-alignment (which is controlled by the dir=ltr/rtl attribute) #6638

Closed
Reinmar opened this issue Apr 21, 2020 · 0 comments · Fixed by ckeditor/ckeditor5-table#308
Labels
package:table package:theme-lark type:bug This issue reports a buggy (incorrect) behavior.

Comments

@Reinmar
Copy link
Member

Reinmar commented Apr 21, 2020

📝 Provide detailed reproduction steps (if any)

Currently, the text alignment of a table header cells (<th> elements) are controlled by:

https://github.com/ckeditor/ckeditor5-theme-lark/blob/5f9c8f2b4637a351c755c8e77556bf2e74c66024/theme/ckeditor5-ui/components/editorui/editorui.css#L30-L36

This is a bit accidental but when adding support for RTL/LTR content we agreed with @oleq that it's acceptable.

The problem is that these styles do not use .ck-content so they are missing in https://ckeditor.com/docs/ckeditor5/latest/builds/guides/integration/content-styles.html.

I'd propose adding this:

.ck-content[dir="ltr"] .table th {
	text-align: left;
}

.ck-content[dir="rtl"] .table th {
	text-align: right;
}

to table.css and explain in the aforementioned guide that if you want to have the same styles when the content is displayed on your page, you also need to set the dir attribute correctly.

cc @oleq 


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@Reinmar Reinmar added type:bug This issue reports a buggy (incorrect) behavior. package:theme-lark package:table labels Apr 21, 2020
@Reinmar Reinmar added this to the iteration 31 milestone Apr 21, 2020
oleq added a commit to ckeditor/ckeditor5-table that referenced this issue Apr 22, 2020
Fix: Table feature should specify header text alignment styles for different language directions in the content styles sheet. Closes ckeditor/ckeditor5#6638.

Until now, the text alignment was inherited from `EditorUI` styles but they are unavailable outside the editor when the content lives in a `.ck-content` container.
mlewand pushed a commit that referenced this issue May 1, 2020
Fix: Table feature should specify header text alignment styles for different language directions in the content styles sheet. Closes #6638.

Until now, the text alignment was inherited from `EditorUI` styles but they are unavailable outside the editor when the content lives in a `.ck-content` container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:table package:theme-lark type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant