Git Product home page Git Product logo

Comments (6)

MohammadYounes avatar MohammadYounes commented on May 21, 2024

Is this a specific case or generic one ? Can you detail your use case along with an online sample ?

from rtlcss.

jawadsahil avatar jawadsahil commented on May 21, 2024

I came across this scenario while working on a website, and the use case is same as mentioned above. You can try to apply RTLCSS on this block of css.

.somediv {
    right : 0px /*rtl:5px*/;
}

I was expecting that it will replace the 'right' with 'left' as it is supposed to do so, but if I add the directive, then it does not replace as such.

from rtlcss.

MohammadYounes avatar MohammadYounes commented on May 21, 2024

I meant a real world scenario use-case, The target is to convert LTR CSS to RTL.

Can you explain how an LTR CSS would contain:

.somediv {
  right: 0px;
}

and its RTL counterpart needs to be:

.somediv{
 right: 5px;
}

Thanks!

from rtlcss.

jawadsahil avatar jawadsahil commented on May 21, 2024

I am using JQuery Chosen plugin. The chosen plugin shows as dropdown arrow image that has the following css:

.chosen-container-single .chosen-single div {
    right:0px;
}

when I apply RTLCSS to this, it produces:

.chosen-container-single .chosen-single div {
    left:0px;
}

But the arrow looks odd in that position (It is not odd in original css, because, the arrow has 5 pixels transparent area on the right)... So I want it to move 5px.

Hope this clarifies the situation. ... (I am sorry if this is beyond the scope of your plugin and if I am asking too much. I was just asking if is possible.. In other case I can look for some alternative work around. Thanks)

from rtlcss.

MohammadYounes avatar MohammadYounes commented on May 21, 2024

Thanks for the details, I was just trying to understand the situation in order to provide a solution. I would suggest the following:

  • Customize the rule to fix the issue without affecting the LTR version:
.chosen-container-single .chosen-single div {
    padding-right: 5px;
}

Or

  • Add your own decl. level directive to change the value and allow further processing:
{
  "name": "custom",
  "expr": /(?:\/\*(?:!)?rtl-custom:)([^]*?)(?:\*\/)/img,
  "action": function (decl) {
    this.expr.lastIndex = 0;
    var newValue = this.expr.exec(decl.raws.value.raw)[1];
    decl.raws.value.raw = newValue;
    return false;
  }
}
.somediv {
    left: 0 /*rtl-custom:5px*/;
}

from rtlcss.

jawadsahil avatar jawadsahil commented on May 21, 2024

Thanks Younes,

I really appreciate your work.

from rtlcss.

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.