Skip to content

Instantly share code, notes, and snippets.

@AmrEldib
Created January 2, 2016 19:32
Show Gist options
  • Save AmrEldib/442b6f27b9887dd97d71 to your computer and use it in GitHub Desktop.
Save AmrEldib/442b6f27b9887dd97d71 to your computer and use it in GitHub Desktop.
Updated UserStyle for Better Arabic Font on Twitter
/*
This is a modified version of the userstyle "Twitter Persian/Arabic Optimization"
https://userstyles.org/styles/119923/twitter-persian-arabic-optimization
This modification applies the Arabic font only on text with Arabic language while keeping
other languages with the default font
This is done using the :lang(ar) attribute
http://stackoverflow.com/a/15267560/463
*/
@namespace url(http://www.w3.org/1999/xhtml);
@font-face {
font-family: 'Droid Arabic Naskh';
font-style: normal;
font-weight: 400;
src: url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Regular.eot);
src: url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Regular.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Regular.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Regular.woff) format('woff'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Droid Arabic Naskh';
font-style: normal;
font-weight: 700;
src: url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.eot);
src: url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.woff) format('woff'),
url(//fonts.gstatic.com/ea/droidarabicnaskh/v7/DroidNaskh-Bold.ttf) format('truetype');
}
@font-face {
font-family: 'Droid Arabic Kufi';
font-style: normal;
font-weight: 400;
src: url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Regular.eot);
src: url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Regular.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Regular.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Regular.woff) format('woff'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Regular.ttf) format('truetype');
}
@font-face {
font-family: 'Droid Arabic Kufi';
font-style: normal;
font-weight: 700;
src: url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Bold.eot);
src: url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Bold.eot?#iefix) format('embedded-opentype'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Bold.woff2) format('woff2'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Bold.woff) format('woff'),
url(//fonts.gstatic.com/ea/droidarabickufi/v6/DroidKufi-Bold.ttf) format('truetype');
}
@-moz-document url-prefix("https://twitter.com"), url-prefix("http://twitter.com") {
.avatar.js-action-profile-avatar,.DashboardProfileCard-avatarLink.u-inlineBlock,.DashboardProfileCard-avatarImage.js-action-profile-avatar{
border-radius: 30px !important;
}
.TweetTextSize.js-tweet-text.tweet-text.tweet-text-rtl:lang(ar),.tweet-box.rich-editor.notie:lang(ar),.ProfileCardStats-statLabel.u-block:lang(ar),.change-trends.js-trend-toggle:lang(ar),.metadata.social-context:lang(ar),.btn-link.js-refresh-suggestions:lang(ar),.js-view-all-link:lang(ar),.ProfileCardStats-statValue:lang(ar){
font-family: 'Droid Arabic Naskh';
}
.fullname.js-action-profile-name.show-popup-with-id.fullname-rtl:lang(ar),.js-retweet-text:lang(ar),._timestamp.js-short-timestamp.js-relative-timestamp:lang(ar),.new-tweets-bar.js-new-tweets-bar:lang(ar),.trend-location.js-trend-location:lang(ar),.u-tableCell.u-alignMiddle.remove-discover-pymk:lang(ar),.fullname:lang(ar),.flex-module-header > h3,.js-view-all-link:lang(ar),.nav > li > a .text:lang(ar){
font-family: 'Droid Arabic Kufi';
}
.ProfileCardStats-statLabel.u-block{
letter-spacing: opx !important;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment