Skip to content

FR: set HTML direction #83

@omar2205

Description

@omar2205

Describe the problem

we don't add a dir prop to the HTML element.

Describe the proposed solution

In

  1. https://github.com/CodingGarden/listd/blob/main/src/app.html#L2
- <html lang="%lang%">
+ <html lang="%lang%" dir="%dir%">
  1. https://github.com/CodingGarden/listd/blob/main/src/hooks.server.ts#L25
- return resolve(event, { transformPageChunk: ({ html }) => html.replace('%lang%', locale) });
+ const direction = (new Intl.Locale(locale)).textInfo.direction
+ return resolve(event, { transformPageChunk: ({ html }) => html.replace('%lang%', locale).replace('%dir%', direction) });

Intl.Locale ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale

Have you checked if this issue has already been raised?

  • I did not find any similar issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions