Skip to content

Commit

Permalink
feat: no-scrollbar tailwind plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Aug 24, 2022
1 parent 8f38d19 commit aed4e16
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const pluginSafeAreas = require('./config/plugin-safe-areas.js');
const pluginTranslucent = require('./config/plugin-translucent.js');
const pluginRange = require('./config/plugin-range.js');
const pluginTouch = require('./config/plugin-touch.js');
const pluginNoScrollbar = require('./config/plugin-no-scrollbar.js');
const mdColors = require('./config/md-colors.js');

const content = `${path.resolve(__dirname)}/**/*.{js,jsx,vue,svelte}`;
Expand All @@ -34,6 +35,7 @@ const config = (userConfig = {}) => {
pluginTranslucent(),
pluginRange(),
pluginTouch(),
pluginNoScrollbar(),
],
},
userConfig
Expand Down
16 changes: 16 additions & 0 deletions src/config/plugin-no-scrollbar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const plugin = require('tailwindcss/plugin');

module.exports = () =>
plugin(({ addUtilities }) => {
const noScrollbar = {
'.no-scrollbar': {
'scrollbar-width': 'none',
},
'.no-scrollbar::-webkit-scrollbar': {
display: 'none',
opacity: '0',
},
};

addUtilities(noScrollbar);
});

0 comments on commit aed4e16

Please sign in to comment.