Skip to content

Css in js/mixins#16

Merged
thompsongl merged 16 commits intothompsongl:css-in-js/mixinsfrom
cchaos:css-in-js/mixins
Apr 12, 2022
Merged

Css in js/mixins#16
thompsongl merged 16 commits intothompsongl:css-in-js/mixinsfrom
cchaos:css-in-js/mixins

Conversation

@cchaos
Copy link
Copy Markdown

@cchaos cchaos commented Apr 11, 2022

The main portion here is that instead of hooks/functions for each separate shadow, I wanted to create a single hook that took a shadow size (t-shirt style) and optional color. Also changing naming pattern to remove Style and mixin and just ensure we use the eui prefix.

I also shifted around a bunch of the scroll/overflow function/mixin docs.

You can read through my commits.

*/
export const mixinSlightShadowActiveStyles = mixinSlightShadowHoverStyles;
export const useSlightShadowActiveStyles = useSlightShadowHoverStyles;
export const useEuiShadow = (
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Create a non-hook version

// Just overflow and scrollbars
export const mixinYScrollStyles = (euiTheme: UseEuiTheme['euiTheme']) => `
${mixinScrollBarStyles(euiTheme)}
// TODO: How do we use Emotion to output the CSS class utilities instead?
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could do it with <Global />. Something like

<Global
  styles={css`
    .euiYScroll { ${euiYScroll()} }
    .euiXScroll { ${euiXScroll()} }
  `}
/>

@media screen and (prefers-reduced-motion: no-preference) {
${content}
// One hook to rule them all
export const useEuiOverflowScroll = (
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Make non-hook version

@thompsongl
Copy link
Copy Markdown
Owner

Merging this now and I'll follow up with making non-hook versions of the 2 new hooks

@thompsongl thompsongl merged commit 677390c into thompsongl:css-in-js/mixins Apr 12, 2022
@cchaos cchaos deleted the css-in-js/mixins branch May 8, 2022 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants