oyvindeh / flipcss Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
amazing stuff by the way
just thought id highlight a bug...
this "padding: 0 2em 0 3em" will flip to this "padding: 0 3em 0 2em" perfectly fine.
However...
this "padding: 0 2.5em 0 3.5em" will not flip
seems that adding a "." to the padding value stops it from working
The "left" and "right" keywords are always matched. This is useful when they are part of for example a filename ("arrow-left.png"). However, it is not so usefull when you have a class name containing one of them (e.g. ".copyright").
Suggestion: Check if "left"/"right" is part of a word, or separated somehow. Separators could be dots, hyphens, underscores, whitespace, etc. Swap if there is a separator, but leave if there is not.
Used as a library, rtl/ltr-only rules can be cleaned without flipping. This is currently not possible from command line. This should be added.
Tests should be refactored to not rely on fixtures (except for the functional tests).
Reason: If a test fails, it is difficult to find out exactly what makes it break. Close inspection of the input, output and expected output is needed. By adding one test for each case to be tested, you can spot what makes it break immediately.
Hi, you've added support for swapping pseudo elements in #8 issue, but there is no way how to set this option to true because current API signature is
flip(String css, Boolean warnings)
Support for running flipcss from command line should be added.
The library should support RTL>LTR conversion, in addition to LTR>RTL.
Currently, "direction: rtl" is always added when calling flip(), breaking support for RTL>LTR. This can be fixed by adding a parameter to flip(), telling the direction and then adding direction rule to body based on that. If no direction is given, it should still flip.
As there is already an optional boolean parameter about warnings, the best solution is probably to accept an options JSON object to flip(), like so:
options = { warnings: true, direction: "ltr"}; # both warnings and direction are optional flip(options)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.