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

versioning question #11

Open
KevinBatdorf opened this issue Dec 11, 2019 · 7 comments
Open

versioning question #11

KevinBatdorf opened this issue Dec 11, 2019 · 7 comments

Comments

@KevinBatdorf
Copy link

Hi,

Increasing the major version often implies there are breaking changes, but i can't tell outright from the commits whether this is the case.

Are you using a specific versioning strategy like semver?

Thanks

@RonMelkhior
Copy link
Owner

RonMelkhior commented Dec 11, 2019 via email

@KevinBatdorf
Copy link
Author

Can you explain what the breaking change from 3.0.2 -> 4.0.0 was? Thanks

@KevinBatdorf
Copy link
Author

Looking here it seems like you updated it to generate classnames in case someone wants to add a class to the html element. Is that correct?

@RonMelkhior
Copy link
Owner

We added support for same-level dir attributes. So for example:

<div dir="rtl" class="ltr:ml-10 rtl:mr-10">
  <span class="ltr:ml-6 rtl:mr-6">Hi!</span>
</div>

Previously, in v3, the rtl:mr-10 class in the div wouldn't work because the CSS generated only checked if a parent element had the dir attribute.

In v4, we added support for same level (which you can see from the generated CSS in the test in the link you sent).

Obviously this can lead to some side effects, so I bumped the major version.

@KevinBatdorf
Copy link
Author

Okay, I understand. Is it normal to add the dir attribute like that (I'm genuinely asking as I don't know)?

If not, it seems like something that could be an option? Especially since it will nearly double the output size. I imagine it could an easy edit. I can send a PR if you'd like.

@RonMelkhior
Copy link
Owner

In this project where I use this library, there are certain areas where I have to force LTR regardless of the site's general direction/language at that moment, so it can be handy.

As for size/making this an option, if you are using PurgeCSS, I wouldn't worry about the size too much, but if you insist, you can submit a PR to add an option to disable same-level support.

@KevinBatdorf
Copy link
Author

Okay thanks. I'll send a PR in the next day or two to disable it. I'm using this on a WordPress project where I can't readily purge the CSS, unfortunately.

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

No branches or pull requests

2 participants