Skip to content

Commit

Permalink
feat: add scroll-margin and scroll-padding utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammadsammy committed Dec 17, 2021
1 parent e7d5070 commit e3503e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/cli/core/ClassnamesGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,20 @@ export class ClassnamesGenerator {
};

private interactivity = (): Interactivity => {
const sides = ['', 'y', 'x', 't', 'r', 'b', 'l'];

return {
...nonConfigurableClassNames.interactivity,
cursor: Object.keys(this._theme.cursor).map(x => 'cursor-' + x),
caretColor: this.generateClassesWithColors('caretColor'),
willChange: Object.keys(this._theme.willChange).map(x => 'will-change-' + x),
accentColor: this.generateClassesWithColors('accentColor'),
scrollPadding: sides.flatMap(side => {
return Object.keys(this._theme.scrollPadding).map(value => `scroll-p${side}-${value}`);
}),
scrollMargin: sides.flatMap(side => {
return Object.keys(this._theme.scrollMargin).map(value => `scroll-m${side}-${value}`);
}),
};
};

Expand Down
4 changes: 3 additions & 1 deletion src/cli/types/classes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ type TInteractivityCategoryItem =
| 'caretColor'
| 'willChange'
| 'accentColor'
| 'scrollSnap';
| 'scrollSnap'
| 'scrollMargin'
| 'scrollPadding';

type TLayoutCategoryItem =
| 'display'
Expand Down

0 comments on commit e3503e9

Please sign in to comment.