design-angular-kit icon indicating copy to clipboard operation
design-angular-kit copied to clipboard

feat(overflow): add itOverflowX and itOverflowY directives (#610)

Open giulio-leone opened this issue 8 months ago • 1 comments

Closes #610

Problem

Bootstrap Italia's utility classes only set the shorthand overflow property, providing no way to control overflow-x and overflow-y independently. This limits layouts that need horizontal scroll containment without affecting vertical behavior (or vice versa).

Solution

Add two standalone Angular directives:

  • ItOverflowXDirective — binds to [itOverflowX], controls overflow-x via @HostBinding('style.overflow-x')
  • ItOverflowYDirective — binds to [itOverflowY], controls overflow-y via @HostBinding('style.overflow-y')

Both directives accept 'auto' | 'hidden' | 'visible' | 'scroll' | 'clip'.

They can be combined on the same element for independent axis control:

<div itOverflowX="auto" itOverflowY="hidden">...</div>

Testing

  • 11 tests covering all 5 overflow-x values, 5 overflow-y values, and combined usage
  • Double gate passed: 120/120 tests ✅, 0 lint errors ✅

Checklist

  • [x] Follows CONTRIBUTING.md guidelines
  • [x] Uses standalone components (no NgModule)
  • [x] Uses inject() function per @angular-eslint/prefer-inject
  • [x] Selector prefix it enforced
  • [x] Exported from public_api.ts
  • [x] Conventional commit message

⚠️ This reopens #642 which was accidentally closed due to fork deletion.

giulio-leone avatar Mar 25 '26 19:03 giulio-leone

@simionato-ennovaresearch this is the active successor to #642 and it already includes the follow-up you asked for there: both the Angular-friendly directive path and the plain CSS/docs/examples path.

Current build/tests are green. The only red check is lint-commits, but its log shows a Docker pull auth/rate-limit failure on wagoid/commitlint-github-action:5.5.1, not a code/content issue.

If the approach looks right now, I would appreciate a review on this open PR rather than on the closed predecessor. Thanks!

giulio-leone avatar Mar 27 '26 21:03 giulio-leone