File size: 1,603 Bytes
14aebdf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
RTL_CSS = """
/* RTL Support for Persian/Arabic */
.gradio-container {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix input fields alignment */
.gr-textbox, .gr-number, .gr-slider {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix labels */
label {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix buttons */
.gr-button {
    direction: rtl !important;
}

/* Fix markdown content */
.gr-markdown {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix specific input elements */
input[type="number"], input[type="text"], textarea {
    direction: rtl !important;
    text-align: right !important;
}

/* Fix column layouts */
.gr-column {
    direction: rtl !important;
}

/* Fix row layouts */
.gr-row {
    direction: rtl !important;
}

/* Fix slider component */
.gr-slider input {
    direction: ltr !important;
}

/* Ensure proper spacing for Persian text */
body {
    font-family: 'Tahoma', 'Arial', sans-serif !important;
    direction: rtl !important;
}

/* Fix any remaining LTR elements */
* {
    direction: inherit;
}

/* Special fixes for gradio components */
.wrap.svelte-1116kco {
    direction: rtl !important;
}

.container.svelte-1116kco {
    direction: rtl !important;
}
"""

HTML_HEAD = """
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
    @import url('https://fonts.googleapis.com/css2?family=Vazir:wght@300;400;500;600&display=swap');
    body { font-family: 'Vazir', 'Tahoma', Arial, sans-serif !important; }
</style>
"""