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

When you set '' in class() method it should not return class="" #77

Closed
terabytesoftw opened this issue Jul 22, 2021 · 5 comments
Closed
Labels
type:enhancement Enhancement

Comments

@terabytesoftw
Copy link
Member

Q A
Version 3
PHP version 8.0
Operating system Windows11
@vjik
Copy link
Member

vjik commented Jul 22, 2021

For remove attribute in other methods we use null, for example ->id(null). I think in class we also should use null for don't add class and empty string should add attribute. See PR #78, which allow pass null argument to methods Tag::class() and Tag::replaceClass().

@samdark samdark added the type:enhancement Enhancement label Jul 26, 2021
@samdark
Copy link
Member

samdark commented Jul 26, 2021

Empty class doesn't make sense so I agree with @terabytesoftw proposal.

@samdark samdark added the status:ready for adoption Feel free to implement this issue. label Jul 26, 2021
@vjik
Copy link
Member

vjik commented Jul 26, 2021

this is incorrect. empty string and without attribute - this is different cases

@samdark
Copy link
Member

samdark commented Jul 26, 2021

Yes if we do not consider CSS semantics. If we do then empty "class" value doesn't make any sense.

@samdark samdark removed the status:ready for adoption Feel free to implement this issue. label Jul 26, 2021
@samdark
Copy link
Member

samdark commented Jul 26, 2021

Still, for consistency purposes and following formal spec it makes sense to use nulls instead as in #78.

@samdark samdark closed this as completed Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement
Projects
None yet
Development

No branches or pull requests

3 participants