From 39793c4d49206e9dc24c37f82a4d1b7691448d1b Mon Sep 17 00:00:00 2001 From: yashjawale Date: Mon, 30 Nov 2026 13:18:37 +0530 Subject: [PATCH] fix: align sidebar template content to the right in RTL --- style.css | 14 ++++++++++++++ style.min.css | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/style.css b/style.css index 1361eca..2184135 100644 --- a/style.css +++ b/style.css @@ -266,6 +266,20 @@ header.wp-block-template-part:has(> .is-position-sticky):has(.wp-block-navigatio flex-grow: 1; } +/* + * Sidebar templates: the main column is a constrained layout justified to the + * left, so its content keeps the content width against the edge away from the + * sidebar. Core writes that justification as physical margins (margin-left: 0, + * margin-right: auto) with no RTL counterpart, so in RTL the content stays on + * the left and leaves a gap against the right edge. Swap the margins so the + * content sits at the start edge in either direction. Core's margins are + * !important, so these must be too. + */ +.rtl main > .wp-block-columns > .wp-block-column.is-content-justification-left > :where(:not(.alignleft):not(.alignright):not(.alignfull)) { + margin-left: auto !important; + margin-right: 0 !important; +} + /* * Arrival bar: the blank canvas keeps index and single visually close, so a * thin accent bar sweeps the top of the viewport when a single post loads, diff --git a/style.min.css b/style.min.css index afaedfd..669e7c8 100644 --- a/style.min.css +++ b/style.min.css @@ -1 +1 @@ -@media(prefers-reduced-motion:no-preference){@view-transition{navigation:auto}}body{text-rendering:geometricprecision;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:break-word}blockquote,caption,figcaption,h1,h2,h3,h4,h5,h6,p{text-wrap:pretty}a,ins,span[style*=text-decoration],u{text-decoration-thickness:1px!important;text-decoration-style:dotted!important;text-underline-offset:.1em}:where(.wp-site-blocks :focus-visible:not(.wp-element-button,.wp-block-button__link)){outline:2px dotted currentcolor;outline-offset:2px}:target{scroll-margin-block-start:var(--wp--preset--spacing--50)}#comments{scroll-margin-block-start:var(--wp--preset--spacing--70)}.more-link{display:block}:where(pre){overflow-x:auto}footer.wp-block-template-part,header.wp-block-template-part{margin-block-start:0}.wp-block-table :is(table,td,th){border-color:var(--wp--preset--color--accent-6)}.wp-block-table thead{background-color:var(--wp--preset--color--accent-5);border-bottom-width:1px!important;border-bottom-color:var(--wp--preset--color--accent-6)}.wp-block-table thead th{text-align:start;font-family:var(--wp--preset--font-family--manrope);font-size:var(--wp--preset--font-size--small);font-style:normal;font-weight:700}.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background-color:var(--wp--preset--color--accent-5)}.wp-block-table.is-style-stripes{border-bottom-color:var(--wp--preset--color--accent-5)}.author-card:not(:has(.wp-block-post-author-name)),.comments-meta:not(:has(.wp-block-post-comments-link)){display:none}.wp-block-comment-author-name{overflow-wrap:anywhere}header.wp-block-template-part:has(>.is-position-sticky){position:sticky;inset-block-start:0;z-index:10}.admin-bar header.wp-block-template-part:has(>.is-position-sticky){inset-block-start:var(--wp-admin--admin-bar--height,32px)}@media(max-width:600px){.admin-bar header.wp-block-template-part:has(>.is-position-sticky){inset-block-start:0}}html:has(header.wp-block-template-part>.is-position-sticky){scroll-padding-block-start:calc(10rem + var(--wp-admin--admin-bar--height,0px))}header.wp-block-template-part:has(>.is-position-sticky):has(.wp-block-navigation__responsive-container.is-menu-open){z-index:100000}.wp-site-blocks{display:flex;flex-direction:column;min-height:100vh;min-height:calc(100svh - var(--wp-admin--admin-bar--height,0px))}.wp-site-blocks>main{flex-grow:1}@media(prefers-reduced-motion:no-preference){.single:before{content:"";position:fixed;inset-block-start:0;inset-inline-start:0;block-size:3px;inline-size:100%;background-color:var(--wp--preset--color--accent-1);z-index:99;pointer-events:none;transform-origin:left;animation:ipsum-arrival .9s ease-out forwards}.rtl.single:before{transform-origin:right}.admin-bar.single:before{inset-block-start:var(--wp-admin--admin-bar--height,32px)}@keyframes ipsum-arrival{0%{transform:scaleX(0);opacity:1}60%{transform:scaleX(1);opacity:1}to{transform:scaleX(1);opacity:0}}} \ No newline at end of file +@media(prefers-reduced-motion:no-preference){@view-transition{navigation:auto}}body{text-rendering:geometricprecision;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;overflow-wrap:break-word}blockquote,caption,figcaption,h1,h2,h3,h4,h5,h6,p{text-wrap:pretty}a,ins,span[style*=text-decoration],u{text-decoration-thickness:1px!important;text-decoration-style:dotted!important;text-underline-offset:.1em}:where(.wp-site-blocks :focus-visible:not(.wp-element-button,.wp-block-button__link)){outline:2px dotted currentcolor;outline-offset:2px}:target{scroll-margin-block-start:var(--wp--preset--spacing--50)}#comments{scroll-margin-block-start:var(--wp--preset--spacing--70)}.more-link{display:block}:where(pre){overflow-x:auto}footer.wp-block-template-part,header.wp-block-template-part{margin-block-start:0}.wp-block-table :is(table,td,th){border-color:var(--wp--preset--color--accent-6)}.wp-block-table thead{background-color:var(--wp--preset--color--accent-5);border-bottom-width:1px!important;border-bottom-color:var(--wp--preset--color--accent-6)}.wp-block-table thead th{text-align:start;font-family:var(--wp--preset--font-family--manrope);font-size:var(--wp--preset--font-size--small);font-style:normal;font-weight:700}.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background-color:var(--wp--preset--color--accent-5)}.wp-block-table.is-style-stripes{border-bottom-color:var(--wp--preset--color--accent-5)}.author-card:not(:has(.wp-block-post-author-name)),.comments-meta:not(:has(.wp-block-post-comments-link)){display:none}.wp-block-comment-author-name{overflow-wrap:anywhere}header.wp-block-template-part:has(>.is-position-sticky){position:sticky;inset-block-start:0;z-index:10}.admin-bar header.wp-block-template-part:has(>.is-position-sticky){inset-block-start:var(--wp-admin--admin-bar--height,32px)}@media(max-width:600px){.admin-bar header.wp-block-template-part:has(>.is-position-sticky){inset-block-start:0}}html:has(header.wp-block-template-part>.is-position-sticky){scroll-padding-block-start:calc(10rem + var(--wp-admin--admin-bar--height,0px))}header.wp-block-template-part:has(>.is-position-sticky):has(.wp-block-navigation__responsive-container.is-menu-open){z-index:100000}.wp-site-blocks{display:flex;flex-direction:column;min-height:100vh;min-height:calc(100svh - var(--wp-admin--admin-bar--height,0px))}.wp-site-blocks>main{flex-grow:1}.rtl main>.wp-block-columns>.wp-block-column.is-content-justification-left>:where(:not(.alignleft):not(.alignright):not(.alignfull)){margin-left:auto!important;margin-right:0!important}@media(prefers-reduced-motion:no-preference){.single:before{content:"";position:fixed;inset-block-start:0;inset-inline-start:0;block-size:3px;inline-size:100%;background-color:var(--wp--preset--color--accent-1);z-index:99;pointer-events:none;transform-origin:left;animation:ipsum-arrival .9s ease-out forwards}.rtl.single:before{transform-origin:right}.admin-bar.single:before{inset-block-start:var(--wp-admin--admin-bar--height,32px)}@keyframes ipsum-arrival{0%{transform:scaleX(0);opacity:1}60%{transform:scaleX(1);opacity:1}to{transform:scaleX(1);opacity:0}}} \ No newline at end of file