Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customisation examples #151

Open
MichalBryxi opened this issue Apr 5, 2021 · 3 comments
Open

Customisation examples #151

MichalBryxi opened this issue Apr 5, 2021 · 3 comments
Labels
Type: Documentation Improvements or additions to documentation

Comments

@MichalBryxi
Copy link
Contributor

MichalBryxi commented Apr 5, 2021

My original goal was to simply tell <Button @intent='primary' /> that it's supposed to be different color (background and text) than the default. I know that I can tell it to @appearance="custom" and add custom classes, but that seems like an overkill given that I just want different pick on the colors. I've seen PRs talking about customisation, but those don't really live in the documentation & I'm not really sure how would that translate to my case.

So I thought that section with customisation examples & list of options for each component would be the best thing to ask for the sake of other users?

@betocantu93
Copy link
Contributor

betocantu93 commented Apr 12, 2021

I struggled with this too, TBH! specially because I was completely new to tailwind (still a newb) just wandering...

Here's an example!

const defaultTheme = require('tailwindcss/resolveConfig')(
  require('tailwindcss/defaultConfig')
).theme;

module.exports = {
  future: {
    // removeDeprecatedGapUtilities: true,
    // purgeLayersByDefault: true,
  },
  purge: ['./app/**/*.html', './app/**/*.hbs'],
  theme: {
    frontile: {
      buttons: {
        config: {
          minimal: {
            hoverBackgroundColor: defaultTheme.colors.indigo[200],
            activeBackgroundColor: defaultTheme.colors.indigo[300],
          },
          primary: {
            contrastColor: defaultTheme.colors.white,
            color: defaultTheme.colors.indigo[700],
            hoverColor: defaultTheme.colors.indigo[800],
            activeColor: defaultTheme.colors.indigo[900],
          },
        },
      },
      overlays: {
        config: {
          drawer: {
            sizes: {
              xl: '64rem',
            },
          },
        },
      },
    },
    extend: {
      screens: {
        standalone: { raw: '(display-mode: standalone)' },
      },
      maxWidth: {
        '30rem': '30rem',
        '20rem': '20rem',
        '15rem': '15rem'
      },
      minWidth: {
        '30rem': '30rem',
        '20rem': '20rem',
        '15rem': '15rem'
      },
      
    },
  },
  variants: {},
  plugins: [
    require('@frontile/core/tailwind'),
    require('@frontile/overlays/tailwind'),
    require('@frontile/buttons/tailwind'),
    require('@frontile/forms/tailwind'),
    require('tailwindcss-ember-power-select'),
    require('@frontile/notifications/tailwind'),
  ],
};

Had to place a few console.logs to understand how to custormize the primary color, and you can see the options inside each particular plugin, i.e.

But I do agree, documentation for this could pave the way for adopters, I really had a bad time there haha

@josemarluedke
Copy link
Owner

Sorry about the missing documentation here. I totally agree that we need documentation for this section.

The good news is being able to fully change the styles is one of the founding goals of this project.

@josemarluedke josemarluedke added the Type: Documentation Improvements or additions to documentation label Apr 16, 2021
@acorncom
Copy link
Contributor

@josemarluedke do you have thoughts on where you'd want this type of example put? Our team just got snagged by this, so I'd happily put in a bit of time to build out a basic page on the docs site that would explain what @betocantu93 wrote up above ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants