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

feat: support additional properties to utility method #120

Merged

Conversation

allangaldinosilva
Copy link
Contributor

This PR enhances the utility method to support additional properties. For instance, the lineClamp property does have additional properties but those can't be passed to the lineClamp(value) utility method.

Before

/** Sets `WebkitLineClamp: value`. */
  lineClamp(value: Properties["WebkitLineClamp"]) {
    return this.add("WebkitLineClamp", value);
  }

After

/** Sets `WebkitLineClamp: value`. */
  lineClamp(value: Properties["WebkitLineClamp"]) {
    return this.add("WebkitLineClamp", value) // default def
    .add("overflow", "hidden").add("display", "-webkit-box").add("WebkitBoxOrient","vertical",).add("textOverflow", "ellipsis"); // additional defs
  }

With these changes, lineClamp(value) will have the ability to define additional properties combining to the value param.

Also, added a few tests for packages/truss/src/methods.test.ts

cc @bdow since he's going to use it.

@allangaldinosilva allangaldinosilva added the enhancement New feature or request label May 17, 2024
Copy link
Contributor

@stephenh stephenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few rename suggestions, but looks great, thanks @allangaldinosilva !

@allangaldinosilva allangaldinosilva merged commit a92172d into main May 20, 2024
2 checks passed
@allangaldinosilva allangaldinosilva deleted the support-additional-properties-in-utility-method branch May 20, 2024 15:01
homebound-team-bot pushed a commit that referenced this pull request May 20, 2024
# [1.134.0](v1.133.0...v1.134.0) (2024-05-20)

### Features

* support additional properties to utility method ([#120](#120)) ([a92172d](a92172d))
@homebound-team-bot
Copy link

🎉 This PR is included in version 1.134.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants