Skip to content

Commit

Permalink
docs(examples): use RTLCSS for RTL examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd authored and XhmikosR committed Dec 4, 2020
1 parent eb61839 commit 3ef8483
Show file tree
Hide file tree
Showing 16 changed files with 455 additions and 59 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"css-prefix": "npm-run-all --parallel css-prefix-*",
"css-prefix-main": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.rtl*.css\" \"!dist/css/*.min.css\"",
"css-prefix-examples": "postcss --config build/postcss.config.js --replace \"site/content/**/*.css\"",
"css-prefix-examples-rtl": "cross-env NODE_ENV=RTL postcss --config build/postcss.config.js --dir \"site/content/docs/$npm_package_version_short/examples/\" --ext \".rtl.css\" --base \"site/content/docs/$npm_package_version_short/examples/\" \"site/content/docs/$npm_package_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.css\" \"!site/content/docs/$npm_package_version_short/examples/{blog,carousel,dashboard,cheatsheet}/*.rtl.css\"",
"js": "npm-run-all js-compile js-minify",
"js-compile": "npm-run-all --parallel js-compile-*",
"js-compile-standalone": "rollup --environment BUNDLE:false --config build/rollup.config.js --sourcemap",
Expand Down
6 changes: 0 additions & 6 deletions site/content/docs/5.0/examples/blog-rtl/blog-rtl.css

This file was deleted.

3 changes: 1 addition & 2 deletions site/content/docs/5.0/examples/blog-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
direction: rtl
extra_css:
- "https://fonts.googleapis.com/css?family=Amiri:wght@400;700&display=swap"
- "../blog/blog.css"
- "blog-rtl.css"
- "../blog/blog.rtl.css"
include_js: false
---

Expand Down
4 changes: 2 additions & 2 deletions site/content/docs/5.0/examples/blog/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

.blog-header-logo {
font-family: "Playfair Display", Georgia, "Times New Roman", serif;
font-family: "Playfair Display", Georgia, "Times New Roman", serif/*rtl:Amiri, Georgia, "Times New Roman", serif*/;
font-size: 2.25rem;
}

Expand All @@ -15,7 +15,7 @@
}

h1, h2, h3, h4, h5, h6 {
font-family: "Playfair Display", Georgia, "Times New Roman", serif;
font-family: "Playfair Display", Georgia, "Times New Roman", serif/*rtl:Amiri, Georgia, "Times New Roman", serif*/;
}

.display-4 {
Expand Down
103 changes: 103 additions & 0 deletions site/content/docs/5.0/examples/blog/blog.rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
/* stylelint-disable selector-list-comma-newline-after */

.blog-header {
line-height: 1;
border-bottom: 1px solid #e5e5e5;
}

.blog-header-logo {
font-family: Amiri, Georgia, "Times New Roman", serif;
font-size: 2.25rem;
}

.blog-header-logo:hover {
text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
font-family: Amiri, Georgia, "Times New Roman", serif;
}

.display-4 {
font-size: 2.5rem;
}
@media (min-width: 768px) {
.display-4 {
font-size: 3rem;
}
}

.nav-scroller {
position: relative;
z-index: 2;
height: 2.75rem;
overflow-y: hidden;
}

.nav-scroller .nav {
display: flex;
flex-wrap: nowrap;
padding-bottom: 1rem;
margin-top: -1px;
overflow-x: auto;
text-align: center;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}

.nav-scroller .nav-link {
padding-top: .75rem;
padding-bottom: .75rem;
font-size: .875rem;
}

.card-img-right {
height: 100%;
border-radius: 3px 0 0 3px;
}

.flex-auto {
flex: 0 0 auto;
}

.h-250 { height: 250px; }
@media (min-width: 768px) {
.h-md-250 { height: 250px; }
}

/* Pagination */
.blog-pagination {
margin-bottom: 4rem;
}
.blog-pagination > .btn {
border-radius: 2rem;
}

/*
* Blog posts
*/
.blog-post {
margin-bottom: 4rem;
}
.blog-post-title {
margin-bottom: .25rem;
font-size: 2.5rem;
}
.blog-post-meta {
margin-bottom: 1.25rem;
color: #727272;
}

/*
* Footer
*/
.blog-footer {
padding: 2.5rem 0;
color: #727272;
text-align: center;
background-color: #f9f9f9;
border-top: .05rem solid #e5e5e5;
}
.blog-footer p:last-child {
margin-bottom: 0;
}
8 changes: 0 additions & 8 deletions site/content/docs/5.0/examples/carousel-rtl/carousel-rtl.css

This file was deleted.

3 changes: 1 addition & 2 deletions site/content/docs/5.0/examples/carousel-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
title: قالب دائري
direction: rtl
extra_css:
- "../carousel/carousel.css"
- "carousel-rtl.css"
- "../carousel/carousel.rtl.css"
---

<header>
Expand Down
3 changes: 3 additions & 0 deletions site/content/docs/5.0/examples/carousel/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ body {
.marketing h2 {
font-weight: 400;
}
/* rtl:begin:ignore */
.marketing .col-lg-4 p {
margin-right: .75rem;
margin-left: .75rem;
}
/* rtl:end:ignore */


/* Featurettes
Expand All @@ -63,6 +65,7 @@ body {
.featurette-heading {
font-weight: 300;
line-height: 1;
/* rtl:remove */
letter-spacing: -.05rem;
}

Expand Down
89 changes: 89 additions & 0 deletions site/content/docs/5.0/examples/carousel/carousel.rtl.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */

body {
padding-top: 3rem;
padding-bottom: 3rem;
color: #5a5a5a;
}


/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */

/* Carousel base class */
.carousel {
margin-bottom: 4rem;
}
/* Since positioning the image, we need to help out the caption */
.carousel-caption {
bottom: 3rem;
z-index: 10;
}

/* Declare heights because of positioning of img element */
.carousel-item {
height: 32rem;
}
.carousel-item > img {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
height: 32rem;
}


/* MARKETING CONTENT
-------------------------------------------------- */

/* Center align the text within the three columns below the carousel */
.marketing .col-lg-4 {
margin-bottom: 1.5rem;
text-align: center;
}
.marketing h2 {
font-weight: 400;
}
.marketing .col-lg-4 p {
margin-right: .75rem;
margin-left: .75rem;
}


/* Featurettes
------------------------- */

.featurette-divider {
margin: 5rem 0; /* Space out the Bootstrap <hr> more */
}

/* Thin out the marketing headings */
.featurette-heading {
font-weight: 300;
line-height: 1;
}


/* RESPONSIVE CSS
-------------------------------------------------- */

@media (min-width: 40em) {
/* Bump up size of carousel content */
.carousel-caption p {
margin-bottom: 1.25rem;
font-size: 1.25rem;
line-height: 1.4;
}

.featurette-heading {
font-size: 50px;
}
}

@media (min-width: 62em) {
.featurette-heading {
margin-top: 7rem;
}
}
2 changes: 1 addition & 1 deletion site/content/docs/5.0/examples/cheatsheet-rtl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: examples
title: ورقة غش
extra_css:
- "../cheatsheet/cheatsheet.css"
- "../cheatsheet/cheatsheet.rtl.css"
extra_js:
- src: "../cheatsheet/cheatsheet.js"
body_class: "bg-light"
Expand Down
24 changes: 2 additions & 22 deletions site/content/docs/5.0/examples/cheatsheet/cheatsheet.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ body {
background-size: 1em;
}

[dir="rtl"] .bd-heading a::before {
margin-right: 0;
margin-left: .25rem;
}

/* stylelint-disable-next-line selector-max-universal */
.bd-heading + div > * + * {
margin-top: 3rem;
Expand All @@ -40,11 +35,6 @@ body {
margin-left: -1rem;
}

[dir="rtl"] .bd-aside a:not(:only-child) {
margin-right: -1rem;
margin-left: auto;
}

.bd-aside a:not(:only-child)::before {
width: 1rem;
line-height: 0;
Expand Down Expand Up @@ -86,18 +76,6 @@ body {
margin: 0 1rem 1rem 0;
}

[dir="rtl"] [id="modal"] .bd-example .btn,
[dir="rtl"] [id="buttons"] .bd-example .btn,
[dir="rtl"] [id="tooltips"] .bd-example .btn,
[dir="rtl"] [id="popovers"] .bd-example .btn,
[dir="rtl"] [id="dropdowns"] .bd-example .btn-group,
[dir="rtl"] [id="dropdowns"] .bd-example .dropdown,
[dir="rtl"] [id="dropdowns"] .bd-example .dropup,
[dir="rtl"] [id="dropdowns"] .bd-example .dropend,
[dir="rtl"] [id="dropdowns"] .bd-example .dropstart {
margin: 0 0 1rem 1rem;
}

/* Layout */
@media (min-width: 1200px) {
body {
Expand All @@ -110,8 +88,10 @@ body {
.bd-header {
position: fixed;
top: 0;
/* rtl:begin:ignore */
right: 0;
left: 0;
/* rtl:end:ignore */
z-index: 1030;
grid-column: 1 / span 3;
min-height: 6rem;
Expand Down
Loading

0 comments on commit 3ef8483

Please sign in to comment.