diff options
author | Rami Sabbagh <ramilego4game@gmail.com> | 2022-01-26 05:15:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-26 05:15:02 +0300 |
commit | 086f1e98c193943010f7e3b7889b8f2d0ac4e57b (patch) | |
tree | 34525ef019f6766be206c1bf48c5883f1ace1bbb /assets | |
parent | 9c3d6160dbf9ce9a4556d2746df4e105403e3d20 (diff) |
feat: add RTL layout support and Arabic localization (#159)
* Add direction attribute to the <html> tag
So rtl layout can be activated
* Add `tailwindcss-rtl`
Which brings very handy RTL support to Tailwind CSS
* Load the `tailwindcss-rtl` plugin
* Find and replace many classes into RTL capable ones
* Find and replace many classes into RTL capable ones
* Update the prebuilt css
* Add Arabic localization
* Fix code blocks, force their layout to LTR
* Update the prebuilt css
* Minor improvement to the Arabic localization
* Add singular/plural support for `readingTime`
By following [hugo docs](https://gohugo.io/content-management/multilingual/#query-a-singularplural-translation)
* Add a singular form of `readingTime` for Arabic
* Add a singular form of `readingTime` for English
* Add an additional variant for `readingTime` in the Arabic localization
In Arabic we have a plural for dual, and a plural for 3+.
* Fix left and right arrows not being flipped in RTL
I had to manually flip them in each place
* Revert "Add a singular form of `readingTime` for English"
This reverts commit 73482b600ed7da5fb37b2b5f7d88384a32de18b1.
* Add singular variant for `readingTime` in EN localization
Diffstat (limited to 'assets')
-rw-r--r-- | assets/css/base.css | 4 | ||||
-rw-r--r-- | assets/css/markdown.css | 6 | ||||
-rw-r--r-- | assets/css/site.css | 4 | ||||
-rw-r--r-- | assets/css/tailwind.config.js | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/assets/css/base.css b/assets/css/base.css index 84d1d16..a27af2b 100644 --- a/assets/css/base.css +++ b/assets/css/base.css @@ -21,4 +21,8 @@ a:hover { @apply text-eureka transition duration-300 ease-in-out; +} + +code { + direction: ltr; }
\ No newline at end of file diff --git a/assets/css/markdown.css b/assets/css/markdown.css index da467bf..0bae72e 100644 --- a/assets/css/markdown.css +++ b/assets/css/markdown.css @@ -55,7 +55,7 @@ } .content blockquote { - @apply text-base border-l-4 border-tertiary-text pl-4 pr-4 text-secondary-text; + @apply text-base border-s-4 border-tertiary-text ps-4 pe-4 text-secondary-text; } .content code { @@ -71,11 +71,11 @@ } .content ul { - @apply text-base pl-8 list-disc; + @apply text-base ps-8 list-disc; } .content ol { - @apply text-base pl-8 list-decimal; + @apply text-base ps-8 list-decimal; } .content kbd { diff --git a/assets/css/site.css b/assets/css/site.css index 0a8e083..d4732f5 100644 --- a/assets/css/site.css +++ b/assets/css/site.css @@ -11,11 +11,11 @@ } .sticky-toc ul { - @apply text-base pl-8 list-disc; + @apply text-base ps-8 list-disc; } .sticky-toc ol { - @apply text-base pl-8 list-decimal; + @apply text-base ps-8 list-decimal; } .sticky-toc li + li { diff --git a/assets/css/tailwind.config.js b/assets/css/tailwind.config.js index 88b2d42..405b7b0 100644 --- a/assets/css/tailwind.config.js +++ b/assets/css/tailwind.config.js @@ -53,5 +53,7 @@ module.exports = { } }, variants: {}, - plugins: [] + plugins: [ + require('tailwindcss-rtl') + ] } |