Text Align

What I’m trying to do

Hi, I’m using this snippet to justify my text:

/* align-text justified source view and live preview */
.markdown-source-view.mod-cm6 .cm-line {
	text-align: justify;
	text-justify: inter-word;	
}

/* align-text justified reading mode */
.markdown-preview-view p {
	text-align: justify;
	text-justify: inter-word;	
}

This works great, however, I’d like the justified text align option to exclude Canvas.

Things I have tried

I tried playing around with snippets from this topic but no dice.

Ideally, I’d like to have text align applied everywhere but Canvas, thank you for your help!

Give this a try:

.workspace-leaf-content[data-type="markdown"] :is(.markdown-source-view.mod-cm6 .cm-line, .markdown-preview-view p) {
    text-align: justify;
    text-justify: inter-word;   
}

or broken apart (the above and below will do the same):

.workspace-leaf-content[data-type="markdown"] .markdown-source-view.mod-cm6 .cm-line {
    text-align: justify;
    text-justify: inter-word;   
}

.workspace-leaf-content[data-type="markdown"] .markdown-preview-view p {
    text-align: justify;
    text-justify: inter-word;   
}

The .workspace-leaf-content[data-type="markdown"] part is targeting notes only, so text and file cards in the Canvas are excluded.

1 Like

Amazing! It works, thanks so much @ariehen !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.