Skip to content

Commit 06991ae

Browse files
RTL: Added RTL support for printing and PDF files
1 parent 2c27514 commit 06991ae

3 files changed

Lines changed: 109 additions & 1 deletion

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+

2+
/* --------------------------------------------------------------
3+
Utils
4+
-------------------------------------------------------------- */
5+
6+
.ml-0 { margin-right: 0 !important; }
7+
.ml-1 { margin-right: 4px !important; }
8+
.ml-2 { margin-right: 8px !important; }
9+
.ml-3 { margin-right: 16px !important; }
10+
.ml-4 { margin-right: 24px !important; }
11+
.ml-5 { margin-right: 36px !important; }
12+
.ml-6 { margin-right: 48px !important; }
13+
14+
.mr-0 { margin-left: 0 !important; }
15+
.mr-1 { margin-left: 4px !important; }
16+
.mr-2 { margin-left: 8px !important; }
17+
.mr-3 { margin-left: 16px !important; }
18+
.mr-4 { margin-left: 24px !important; }
19+
.mr-5 { margin-left: 36px !important; }
20+
.mr-6 { margin-left: 48px !important; }
21+
22+
.pl-0 { margin-right: 0 !important; }
23+
.pl-1 { margin-right: 4px !important; }
24+
.pl-2 { margin-right: 8px !important; }
25+
.pl-3 { margin-right: 16px !important; }
26+
.pl-4 { margin-right: 24px !important; }
27+
.pl-5 { margin-right: 36px !important; }
28+
.pl-6 { margin-right: 48px !important; }
29+
30+
.pr-0 { margin-left: 0 !important; }
31+
.pr-1 { margin-left: 4px !important; }
32+
.pr-2 { margin-left: 8px !important; }
33+
.pr-3 { margin-left: 16px !important; }
34+
.pr-4 { margin-left: 24px !important; }
35+
.pr-5 { margin-left: 36px !important; }
36+
.pr-6 { margin-left: 48px !important; }
37+
38+
.text-left { text-align: right }
39+
.text-right { text-align: left }
40+
41+
.pull-left { float: right }
42+
.pull-right { float: left }
43+
44+
/* --------------------------------------------------------------
45+
Tables
46+
-------------------------------------------------------------- */
47+
caption {
48+
text-align: right;
49+
}
50+
51+
th, td {
52+
text-align: right;
53+
}
54+
55+
/* --------------------------------------------------------------
56+
Order Summary (receipts like invoice, packaging slip etc.)
57+
-------------------------------------------------------------- */
58+
59+
.order-summary td .attributes {
60+
margin-left: auto;
61+
margin-right: 30px;
62+
}
63+
64+
.order-summary tr.child-row > td > .associated-product {
65+
margin-left: auto;
66+
margin-right: 30px;
67+
}
68+
69+
70+
/* --------------------------------------------------------------
71+
Order totals
72+
-------------------------------------------------------------- */
73+
74+
.order-totals td.label {
75+
padding-right: 0;
76+
}
77+
78+
.order-totals td.value {
79+
text-align: left;
80+
}
81+
82+
/* --------------------------------------------------------------
83+
catalog
84+
-------------------------------------------------------------- */
85+
86+
.additional-products {
87+
float: right;
88+
margin-left: 20px;
89+
margin-right: auto;
90+
}
91+
.additional-products .picture {
92+
float: right;
93+
margin-left: 20px;
94+
margin-right: auto;
95+
}
96+
97+
/* --------------------------------------------------------------
98+
rtl display breaks text in brackets in chrome
99+
-------------------------------------------------------------- */
100+
h3:after {
101+
content: '\200E';
102+
}

src/Presentation/SmartStore.Web/SmartStore.Web.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@
878878
<Content Include="Content\fontastic\fontastic.css" />
879879
<Content Include="Content\fontastic\fonts\fontastic.svg" />
880880
<Content Include="Content\placeholder.txt" />
881+
<Content Include="Content\print-rtl.css" />
881882
<Content Include="Content\vendors\drift\Drift.js" />
882883
<Content Include="Content\vendors\drift\Drift.min.js" />
883884
<Content Include="Content\vendors\fileuploader\images\loading.gif" />

src/Presentation/SmartStore.Web/Views/Shared/Layouts/_Print.cshtml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@
1111
<title>@Html.SmartTitle(false)</title>
1212
<link rel="stylesheet" type="text/css" href="~/Content/print.css" />
1313

14+
@if (WorkContext.WorkingLanguage.Rtl)
15+
{
16+
<link rel="stylesheet" type="text/css" href="~/Content/print-rtl.css" />
17+
}
18+
1419
@Html.SmartCssFiles(this.Url, ResourceLocation.Head)
1520
@Html.CustomHead()
1621
</head>
17-
<body class="@Html.BodyCssClass()">
22+
<body class="@Html.BodyCssClass()" @Html.LanguageAttributes(true)>
1823
@RenderBody()
1924
@Html.SmartCssFiles(this.Url, ResourceLocation.Foot)
2025
</body>

0 commit comments

Comments
 (0)