Comments (6)
I've seen many converters and all of them fail in automatically providing an RTL variant that is usable with the same html markup (bi-lingual web sites/apps).
Up to now, the default options worked so great for me in many projects, and I believe they work for bootstrap too (see this branch), clone it and run the docs locally. and see for your self! Its auto flipped using rtlcss and without touching the html (thanks to autoRename
) .. check Carousel for example.
tooltip.js was updated to flip the calculated position.
autoRename
(as explained here) works under a simple rule: if a given rule has no directional difference and its opposite exists then the names should be flipped (for example: glyphicon-chevron-left
and glyphicon glyphicon-chevron-right
).
Its unlikely to write a CSS rule having no horizontal significance and name it .right
without an opposite .left
, and in case you do! you can simply mark it with /*rtl:ignore*/
directive.
Since CSS is written in English, I think i18n friendly doesn't apply here. Although rtlcss is highly customizable and you can inject your own logic but I find it useful in case you want to add prev
/next
combination.
from rtlcss.
Without knowing the HTML, flipping the class names based on relatively fragile information can be a problem. I don't think we have a use case for it yet at Twitter. What we rely on is using the equivalent of the rename
directive to change property values in RTL. Either way, it's an opinionated feature that goes beyond CSS bidi flipping, and can easily break on existing codebases, so I was expecting them to be false
in the API by default.
from rtlcss.
Without knowing the HTML, flipping the class names based on relatively fragile information can be a problem.
Can you provide a single example where my approach would fail ?
What we rely on is using the equivalent of the rename directive to change property values in RTL.
Can you clarify with an example ?
Can easily break on existing codebases
I'm using my flipped bootstrap and there is nothing broken! I would appreciate it if you can provide an example.
I feel one of us is missing something here!
from rtlcss.
Can you provide a single example where my approach would fail ?
Any existing code base with urls or classes that contain the strings you're swapping. If it wasn't authored with that expectation, there will be unintentional changes. e.g., maybe there's no image with the new path, or no intent to replace the image, or no intent to rename the class because it will be unchanged in the HTML.
There's a pretty good chance it would break things for our RTL stylesheets. Not saying no one will ever use the feature, but it should be off by default IMO.
Can you clarify with an example ?
.icon-chevronLeft:before { content: "\f00" /*rtl:\f10*/; }
from rtlcss.
I got your point, but still it goes both ways, and I think its a low probability. The replacement is not that aggressive, by default word boundaries are respected. In your example .icon-chevronLeft
will not be auto-renamed unless you turn the greedy
option on (default:off).
Actually, Icon rules in general are the reason behind autoRename
, I don't have to manually maintain mapping between directional rules - take "Font-Awesome" as an example.
I believe a successful flipping requires good understanding of the tool options, The author must compare and validate the generated CSS, Then apply necessary directives to ensure the output is as excpected.
from rtlcss.
@necolas v2.0 is out with more options as false
by default :)
from rtlcss.
Related Issues (20)
- Ignore import not working HOT 5
- The background-position declarations are flipped differently on version v4.0.0 HOT 3
- background-position: HOT 2
- Integrating with Codeigniter
- Bootstrap 5.2 LTR and RTL at the same time (scss with Laravel vite) HOT 14
- using blacklist HOT 3
- aliases options don't work HOT 1
- Don't process data URLs
- Support src() with processUrls
- processUrls shouldn't process non-URL expressions in at-rules
- Bootstrap RTL and LTR at the same time HOT 2
- Unknown word error when "//' is used for commenting in scss files. HOT 1
- issue with media queries and onlyDiff option HOT 1
- This rtlcss package how to use in Laravel vite.config.js HOT 2
- RTLCSS Online
- RTLCSS errors when processing a value directive marked as important
- Tabbed menu not compatible HOT 5
- Can't deal with CSS
- Can't handle CSS style without semicolon HOT 2
- After compilation, ignore is invalid HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rtlcss.