neeto-ui icon indicating copy to clipboard operation
neeto-ui copied to clipboard

Move css to component scope

Open farhanlatheef opened this issue 1 year ago • 3 comments

  • Ref: #2148

Description

  • Changed: Moved button css to component level.

Checklist

  • [x] I have made corresponding changes to the documentation. ~- [ ] I have updated the types definition of modified exports.~
  • [x] I have verified the functionality in some of the neeto web-apps. ~- [ ] I have added tests that prove my fix is effective or that my feature works.~ ~- [ ] I have added proper data-cy and data-testid attributes.~
  • [x] I have added the necessary label (patch/minor/major - If package publish is required).

Reviewers

farhanlatheef avatar Apr 16 '24 13:04 farhanlatheef

@josephmathew900 _a Code explanation: https://farhan-ck.neetorecord.com/watch/b1f86e9e-8240-46b1-84a2-aa005aefbd8d

cc: @praveen-murali-ind

farhanlatheef avatar Apr 18 '24 10:04 farhanlatheef

@farhanlatheef CI is red.

neetogit-bot[bot] avatar Apr 19 '24 14:04 neetogit-bot[bot]

@praveen-murali-ind _a

farhanlatheef avatar Apr 22 '24 11:04 farhanlatheef

Found some edge cases of this approach.

  1. neetoUI provides helper classes for managing the text color, background color, border color, flex, text alignment etc. Since the styles are clubbed with the component in this approach, if a page is not using any neetoUI components, these utility classes won’t work. We are using these classes everywhere in neeto products.

  2. Some of the neetoUI component classes are being used in host applications to reuse the neetoUI styles. In the new approach, reusing the component classes won’t work if the neetoUI component is not being used on that page.

I had a discussion with @josephmathew900 and @AbhayVAshokan regarding these issues. We will check the feasibility of purging the unused CSS instead of the component-scoped CSS approach. Closing this PR and related PRs in host applications. Will do a separate POC for purging CSS for more optimisations.

cc @farhanlatheef

praveen-murali-ind avatar Apr 24 '24 10:04 praveen-murali-ind