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

Default utils #23

Open
jongacnik opened this issue Jan 12, 2018 · 4 comments
Open

Default utils #23

jongacnik opened this issue Jan 12, 2018 · 4 comments

Comments

@jongacnik
Copy link
Owner

jongacnik commented Jan 12, 2018

I wanted to open a thread about what utils might make sense to add to core. One that I am always recreating is letter-spacing:

{
  prop: 'letter-spacing',
  vals: {
    1: '-0.15',
    2: 0
  },
  unit: 'em'
}

I'm also always creating borders, backgrounds, font colors, etc (see my default style.js), but I still think keeping design oriented classes out of core fits better with the intention of this module, since those are the places where I often get specific and granular. Open to a convo on this though.

@jongacnik
Copy link
Owner Author

Going to drop in @s3ththompson's idea from #22:

one utility i think could be added to the default gr8 is a better way to give height to flexbox children when you want to make blocks that maintain aspect ratio when they scale.

I've been using:

{
  prop: { hc: 'height' },
  vals: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
  transform: v => Math.round((v / 12 * 100) * 100000) / 100000,
  unit: 'vw'
}

which gives .hc1{height: 8.33333vw;}, or in other words: height equal to the width of 1 column. Not sure if there's a better pattern or not, though.

@jongacnik jongacnik changed the title Built-in utils Default utils Jan 12, 2018
@jongacnik
Copy link
Owner Author

@gdenisov
Copy link

gdenisov commented Feb 6, 2018

Ability to defined min and max width as function of the grid sizes:

.wmn-c2
.wmx-s4

@sonn-gamm
Copy link

+1 for borders, all the rest imo too project-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants