Global
Global

Global is a component with global styles and javascript.

Styles

You can customize the default styles of this component inside tailwind.config.js setting theme.extend.xtendui.layout see css customization. Check xtendui/src/global.css.js for default styles.

Global Styles

Add to the html the class xt-html to have this features, and add to the body the class xt-body to have this features:

  • Custom body scrollbar and overflow components styles. You can disable this feature with xt-optout-scroll and keep others xt-body features.

Utilities Styles

These are layout utilities.

SyntaxMixinVariantsDescription
Utility.xt-container-resetxt-container-resetresponsiveOn a container reset container styles
Utility.xt-container-removext-container-removeNOT POSSIBLEInside a container child remove horizontal spacing as set in theme.container.padding
Utility.xt-container-yxt-container-yNOT POSSIBLEAs container but with vertical spacing spacing as set in theme.container.padding
Utility.xt-container-y-removext-container-y-removeNOT POSSIBLEInside a xt-container-y child remove vertical spacing as set in theme.container.padding

To have .container fluid so with only one max-width in Tailwind CSS preset set theme.extend.container.fluid: '1536px' with the desired max-width (can also be 'none' to have container with no max-width), see Tailwind CSS container.

Components Styles

These are layout component classes.

SyntaxMixinDescription
Component.xt-overflow-mainxt-overflow-mainOverflow scrollbar style
Component.xt-overflow-subxt-overflow-subOverflow scrollbar style small version
Component[readonly], [disabled], .xt-disabledxt-disabledDisabled styles
Component.xt-backdropxt-backdropBackdrop styles
Component.xt-designxt-designSetup design styles in position absolute

For example to modify the .xt-overflow-main and .xt-overflow-sub scrollbar colors/size, and the ::selection color, use this code in tailwind.config.js.

module.exports = {
  theme: {
    extend: {
      xtendui: {
        global: {
          component: theme => ({
            '::selection': {
              backgroundColor: theme('colors.primary.500'),
              color: theme('colors.white'),
            },
            '.xt-overflow-main': {
              scrollbarColor: `${theme('colors.primary.500')} ${theme('colors.white')}`,
            },
            '.xt-overflow-sub': {
              scrollbarColor: `${theme('colors.gray.500')} transparent`,
            },
          }),
        },
      },
    },
  },
}