Giter VIP home page Giter VIP logo

Comments (2)

xfq avatar xfq commented on August 17, 2024

I'll try writing a rough draft in this issue.

from i18n-drafts.

xfq avatar xfq commented on August 17, 2024

Using CSS logical properties and values

The start of a line is not always the left side of a line. Text aligned to the right in an English page should align to the left on a RTL page. It should align to the top on a page in vertical writing mode. It is possible to make that happen automatically, without the hassle of changing all the CSS in your style sheet. The solution is to use 'logical properties' and 'logical values' when setting up your style: i.e., use 'start' and 'end', rather than 'left' or 'right'.

[ Add illustrations for typical English, Arabic, and vertical Chinese text layout ]

Many people use CSS to style web pages using physical properties and values, such as the familiar margin, padding, and border properties, and the top, right, bottom, and left values.

If we localize this page from English to Arabic, we need to write two sets of style rules for LTR and RTL, like:

[dir="ltr"] .box {
    margin-right: 20px;
}

[dir="rtl"] .box {
    margin-left: 20px;
}

If we use logical properties, it is much simpler:

.box {
    margin-inline-end: 20px;
}

[ List the common logical properties/values and their corresponding physical properties/values, and briefly describe their differences ]

[ Describe the inline dimension and the block dimension ]

[ Talk about browser support? ]

Further reading

from i18n-drafts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.