Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Only rewrite image paths for RTL-variant when files exist #162

Merged
merged 7 commits into from
Mar 10, 2021

Conversation

tobiasso85
Copy link
Contributor

@tobiasso85 tobiasso85 commented Feb 18, 2021

Only rewrite img path to img-RTL in RTL (right-to-left) CSS if image file is present in img-RTL folder.
The mirrored images need to be present on the filesystem. Only if they are present the img url path
is rewritten in the resulting RTL CSS.

Samples

Mirrored

filesystem:

  • img/subfolder/control.png
  • img-RTL/subfolder/control.png

CSS

.myclass {
  background: url(img/subfolder/control.png);
}

RTL CSS

.myclass {
  background: url(img-RTL/subfolder/control.png);
}

Not Mirrored

filesystem:

  • img/subfolder/number.png

CSS

.myclass {
  background: url(img/subfolder/number.png);
}

RTL CSS

.myclass {
  background: url(img/subfolder/number.png);
}

Note: Neither absolute URLs nor absolute paths are rewritten (e.g. background: url(http://example.com/img/fg/hi.png); or background: url(/img/fg/hi.png);)

tobiasso85 and others added 6 commits March 8, 2021 15:28
Only rewrite img path to img-RTL if img-RTL file
is present.
The mirrored images need to be present on the file
system. Only if these are there the img url path
is rewritten.
remove TODO because the parser of less
does not know about the image files
@matz3 matz3 changed the title [FIX] rtl: check img-RTL file presence [BREAKING] Only rewrite image paths for RTL-variant when files exist Mar 10, 2021
@matz3 matz3 merged commit 88e7a74 into master Mar 10, 2021
@matz3 matz3 deleted the rtl-image-mirror-file-check branch March 10, 2021 07:45
openui5bot pushed a commit to SAP/openui5 that referenced this pull request Mar 15, 2021
Update @ui5/* and grunt-openui5 to include
SAP/less-openui5#162

Change-Id: Ic490297541fabc1ff5676b148bd701e75f579675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants