shevy icon indicating copy to clipboard operation
shevy copied to clipboard

Make list of content elements customizable

Open tcharlss opened this issue 5 years ago • 3 comments

Hi,

When using the @include content mixin, it would be nice to be able to customize the list of elements. By default it's just p, ol, ul, pre, but usually I need more : dl, figure, etc. So I end up doing it by hand instead of using that mixin.

Maybe there could be a second parameter to the mixin, or another property in the $shevy-defaults variable ?

tcharlss avatar Jun 14 '19 08:06 tcharlss

Hi @tcharlss, not a bad idea, but it's been a few years since I've looked at or used this code. If you have any interest in making a PR for this feature, that would be great, otherwise I may get to it, but I can't guarantee any time line.

kyleshevlin avatar Jun 14 '19 16:06 kyleshevlin

Sure, I can make a PR. Do you have any preference regarding the implementation ? I'm thinking of adding a content-elements property to $shevy-defaults, like so :

$shevy-defaults: (
  base-font-size: 1em,
  base-line-height: 1.5,
  base-font-scale: (3, 2.5, 2, 1.5, 1.25, 1),
  margin-bottom: true,
  proximity: false,
  proximity-factor: .85,
  content-elements: (p, ol, ul, pre)
);

That way it should be easily customizable.

tcharlss avatar Jun 14 '19 16:06 tcharlss

There are two ways to solve this. You can make a list and generate it that way. Another way could be to expose the styles as a mixin itself, that way you can just @include it in a list of elements you define in your Sass.

kyleshevlin avatar Jun 14 '19 16:06 kyleshevlin