Git Product home page Git Product logo

Comments (5)

tomhughes avatar tomhughes commented on August 15, 2024

Unfortunately I think that will make it much harder for me to review changes to the stylesheets... Basically part of what I do when reviewing changes is:

  1. Look through the diff for common.css etc to see if any rules have been added which have an unbalanced effect on left/right values and which are therefore direction specific and arrange for any such rules to be moved to ltr.css.
  2. Use a visual comparison tool to look at a side by side comparison of ltr.css and rtl.css to make sure that they are same except for left and right being reversed.

Doing what you suggest will obviously render this process impossible in it's current form.

from openstreetmap-website.

samanpwbb avatar samanpwbb commented on August 15, 2024

I can see the benefit of that. I am going to think more about this, but for now, I'll stick with the established pattern.

Regularily jumping between multiple stylesheets makes CSS difficult to write. I wonder if there's a way to use Sass variables to reverse our left:'s to rights's and so forth. Then we only need one stylesheet, and redefine the variables based on reading direction. That could potentially be a great solution right? I don't know enough about Sass to know if this is feasible.

Edit: here's an example of how this might work: http://amitkazmirsky.com/2011/05/29/dry-your-rtl-and-ltr-css-files-in-rails-with-sass/

from openstreetmap-website.

tomhughes avatar tomhughes commented on August 15, 2024

As you discovered, yes it can be done with variables. It can also be done with mixins, as shown here:

http://anasnakawa.github.com/bi-app-sass/

Both give a result that is not exact clean though. Another option, which I'm currently investigating, is to use R2 with a shim to integrate it into the asset serving.

from openstreetmap-website.

tomhughes avatar tomhughes commented on August 15, 2024

I've created tomhughes/openstreetmap-website@2af0d2a which uses R2 to automatically reverse the stylesheet - it's running at http://tomh.apis.dev.openstreetmap.org/ if people want to test it.

from openstreetmap-website.

tomhughes avatar tomhughes commented on August 15, 2024

I merged my fix last week.

from openstreetmap-website.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.