Code Monkey home page Code Monkey logo

gorko's Introduction

Gorko

A tiny, Sass-powered design-token led utility class generator, with handy helpers, that helps you to power your front-ends with a single source of truth.

Table of contents

Getting started

First up, install Gorko:

npm install gorko

In your Sass (SCSS in this case), import Gorko like so:

@import '../path/to/your/node_modules/gorko/gorko.scss';

This will generate utility classes based on the default configuration. To configure it for yourself, take this default, and create your own. Once it is created import your config before Gorko, like this:

@import 'config';

Configuration

This is the default configuration. It is recommended that you use it as your base for your own configuration.

/// BASE SIZE
/// All calculations are based on this. It’s recommended that
/// you keep it at 1rem because that is the root font size. You
/// can set it to whatever you like and whatever unit you like.
///
$gorko-base-size: 1rem;

/// SIZE SCALE
/// This is a Major Third scale that powers all the utilities that
/// it is relevant for (font-size, margin, padding). All items are
/// calcuated off the base size, so change that and cascade across
/// your whole project.
///
$gorko-size-scale: (
  '300': $gorko-base-size * 0.8,
  '400': $gorko-base-size,
  '500': $gorko-base-size * 1.25,
  '600': $gorko-base-size * 1.6,
  '700': $gorko-base-size * 2,
  '900': $gorko-base-size * 3
);

/// COLORS
/// Colors are shared between backgrounds and text by default.
/// You can also use them to power borders, fills or shadows, for example.
///
$gorko-colors: (
  'dark': #1a1a1a,
  'light': #f3f3f3
);

/// CORE CONFIG
/// This powers everything from utility class generation to breakpoints
/// to enabling/disabling pre-built components/utilities.
///
$gorko-config: (
  'bg': (
    'items': $gorko-colors,
    'output': 'standard',
    'property': 'background'
  ),
  'color': (
    'items': $gorko-colors,
    'output': 'standard',
    'property': 'color'
  ),
  'box': (
    'items': (
      'block': 'block',
      'flex': 'flex',
      'hide': 'none',
      'show': 'inherit'
    ),
    'output': 'responsive',
    'property': 'display'
  ),
  'font': (
    'items': (
      'base': 'Helvetica, Arial, sans-serif'
    ),
    'output': 'standard',
    'property': 'font-family'
  ),
  'gap-top': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'margin-top'
  ),
  'gap-right': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'margin-right'
  ),
  'gap-bottom': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'margin-bottom'
  ),
  'gap-left': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'margin-left'
  ),
  'pad-top': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'padding-top'
  ),
  'pad-right': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'padding-right'
  ),
  'pad-bottom': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'padding-bottom'
  ),
  'pad-left': (
    'items': $gorko-size-scale,
    'output': 'standard',
    'property': 'padding-left'
  ),
  'stack': (
    'items': (
      '300': 0,
      '400': 10,
      '500': 20,
      '600': 30,
      '700': 40
    ),
    'output': 'standard',
    'property': 'z-index'
  ),
  'text': (
    'items': $gorko-size-scale,
    'output': 'responsive',
    'property': 'font-size'
  ),
  'weight': (
    'items': (
      'light': '300',
      'regular': '400',
      'bold': '700'
    ),
    'output': 'standard',
    'property': 'font-weight'
  ),
  'width': (
    'items': (
      'full': '100%',
      'half': percentage(1/2),
      'quarter': percentage(1/4),
      'third': percentage(1/3)
    ),
    'output': 'responsive',
    'property': 'width'
  ),
  'breakpoints': (
    'sm': '(min-width: 36em)',
    'md': '(min-width: 48em)',
    'lg': '(min-width: 62em)'
  )
);

Base size (optional)

$gorko-base-size

The base size for the size ratio calculations. It is only required for the default configuration.

Size scale (optional)

$gorko-size-scale

This takes the base size and by default, generates a major third size scale. This can be set to whatever scale you like.

If this is not set, the get-size function will use the default configuration.

Colors (optional)

$gorko-colors

A collection of key/value pairs that by default, generate text and background colour utilities.

If this is not set, the get-color function will use the default configuration.

Gorko config (required)

$gorko-config

🚨 Without this set, Gorko won’t work. 🚨

It contains all of the utility class definitions and breakpoint definitions that the generator and mixins use.

You can add as many or as little utility class definitions as you like—likewise for breakpoint definitions.

Breakpoints

The breakpoints map in $gorko-config defines media queries for the utility class generator. By default, the are set as follows:

'breakpoints': (
	'sm': '(min-width: 36em)',
	'md': '(min-width: 48em)',
	'lg': '(min-width: 62em)'
)

You can add as many or as little of these as you like and call them whatever you like. The only requirement is that the value is a valid media query.

Utility Class Generator

The utility class generator loops through $gorko-config looking for items that have a valid utility class structure. The following structure is required to generate a utility class:

'width':('items':('full':'100%','half': '50%'
  ),
  'output': 'standard',
  'property': 'width'
),;

The first key is the name of the utility and that contains a Sass map. Inside that map, you need to have the following:

  • items: a map of key/value pairs which link a utility class to a CSS property’s value. If you want to use CSS Custom Properties, this should be the string key, referencing the 'css-vars' $gorko-config group that you want to use
  • output: this must be responsive or standard. If you set it to responsive, it will generate the same utility class for every breakpoint that is defined.
  • property: the CSS property that this utility controls.

Example outputs

The above structure would output the following utility classes:

.width-full {
  width: 100%;
}

.width-half {
  width: 50%;
}

If we set the output to be responsive, with the default breakpoints defined, the output would be as follows:

.width-full {
  width: 100%;
}

.width-half {
  width: 50%;
}

@media (min-width: 36em) {
  .sm\:width-full {
    width: 100%;
  }

  .sm\:width-half {
    width: 50%;
  }
}

@media (min-width: 48em) {
  .md\:width-full {
    width: 100%;
  }

  .md\:width-half {
    width: 50%;
  }
}

@media (min-width: 62em) {
  .lg\:width-full {
    width: 100%;
  }

  .lg\:width-half {
    width: 50%;
  }
}

Generating Utility Classes On Demand

The default behaviour of Gorko is to generate utility classes, but in the spirit of being as flexible as possible, you can stop it doing that by setting $generate-utility-classes to false when you pull Gorko into your project, like this:

$generate-utility-classes: false;
@import 'config';
@import '../path/to/your/node_modules/gorko/gorko.scss';

We might want to generate those utility classes later on in the CSS, though, so we use the generate-utility-classes() mixin anywhere after Gorko has been pulled in.

$generate-utility-classes: false;
@import 'config';
@import '../path/to/your/node_modules/gorko/gorko.scss';

// Standard authored CSS
body {
  display: grid;
  place-items: center;
}

// Generate utilities after everything else
@include generate-utility-classes();

Using CSS Custom Properties

See a demo repo

You might want to use CSS Custom Properties instead of static references to tokens. To do so with Gorko, you need to make a couple of adjustments to your $gorko-config.

Firstly, at the top, you need to add a css-vars group which has a key and a value, which should be a map of tokens.

$gorko-config: (
  'css-vars': (
    'color': $gorko-colors,
    'weight': (
      'bold': 700,
      'black': 900
    )
  )
);

In this example, we have defined a 'color' group which uses $gorko-colors, but also a 'weight' group where we have defined key value pairs, just like we do in the utility class generator.

This will now generate a collection of CSS Custom properties like this:

:root {
  --color-dark: #1a1a1a;
  --color-light: #f3f3f3;
  --weight-bold: 700;
  --weight-black: 900;
}

To use CSS Custom Properties in a utility class, we need to first, switch 'items' to be a reference to the 'css-vars' group we want, then set 'css-vars' to be true.

'bg': (
  'items': 'color',
  'css-vars': true,
  'output': 'standard',
  'property': 'background'
)

Now, the background utility classes will look like this:

.bg-dark {
  background: var(--color-dark);
}

.bg-light {
  background: var(--color-light);
}

Note: You can use a combination of CSS Custom Properties and static references to tokens for different utility classes. Gorko is flexible enough to let you do what works for you and your team.

When you enable CSS custom properties, Gorko will generate the :root blocks for you, but sometimes, you might want those :root blocks not to be rendered. This is common if you are generating more than one CSS bundle. To disable the generation of CSS Custom Property blocks, set $generate-css-vars = false;, before you import Gorko, just like generating utility classes on demand.

Using themes

This feature requires Custom Properties

A handy part of the Custom Property support with Gorko is the ability to generate multiple themes. These themes can power dark mode with @media (prefers-color-scheme: dark) or be prefixed with whatever scheme you like.

Let’s say you want a dark mode that both honours the user’s preference, via a media query, and also, can be toggled. The toggle version could use [data-theme="dark"] as its prefix. We’ll generate a default light theme too.

First, we set some values.

$gorko-colors: (
  'dark': #1a1a1a,
  'light': #f3f3f3
);

$light-colors: (
  'text': map-get($gorko-colors, 'dark'),
  'bg': map-get($gorko-colors, 'light')
);

$dark-colors: (
  'text': map-get($gorko-colors, 'light'),
  'bg': map-get($gorko-colors, 'dark')
);

Then, we tweak $gorko-config.

$gorko-config: (
  'css-vars': (
    'themes': (
      'default': (
        'tokens': (
          'color': $light-colors
        )
      ),
      'dark': (
        'prefers-color-scheme': 'dark',
        'tokens': (
          'color': $dark-colors
        )
      ),
      'dark-toggle': (
        'prefix': '[data-theme="dark"]',
        'tokens': (
          'color': $dark-colors
        )
      )
    )
  ),
  /// the rest of your config
);

This then generates the following Custom Properties:

:root {
  --color-text: #1a1a1a;
  --color-bg: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-text: #f3f3f3;
    --color-bg: #1a1a1a;
  }
}

[data-theme='dark'] {
  --color-text: #f3f3f3;
  --color-bg: #1a1a1a;
}

Now, we can style elements like so and regardless of what theme is selected, we won’t have to change our CSS:

.my-element {
  background: var(--color-bg);
  text: var(--color-text);
}

A complete theme map looks like this:

'dark-toggle': ( // Name required
  'prefix': '[data-theme="dark"]', // Optional. Will be :root if not set
  'prefers-color-scheme': 'dark', // Optional. Will generate @media rule if set
  'tokens': ( // Required. Map of key value pairs
    'color': (
      'primary': #1a1a1a,
      'secondary': #f3f3f
    )
  )
)

You can generate as many themes with whatever prefix you can think up!

You could also generate color utility classes using the generator that use these custom properties.

Namespaces

Gorko supports 'namespacing' both the generated class and variable names by allowing you to specify a prefix. This is done using the namespace map within $gorko-config. The default namespace config looks like this:

$gorko-config: (
  'namespace': (
    'prefix': '',             // string
    'classes': true,          // boolean or string
    'css-vars': false         // boolean or string
  )
)

Namespace Settings

prefix

Specifying a value for prefix will append that value to classes (by default) and css variables (opt-in). You are responsible for appending any separating character, such as a dash or underscore. For example, if your namespace is my-app-, you need to add the trailing - character in the 'prefix' section.

classes

Accepts either a boolean value indicating that the prefix should be applied to generated utility classes OR a string, which allows you to override the global prefix

css-vars

Accepts either a boolean value indicating that the prefix should be applied to css-vars OR a string, which allows you to override the global prefix

Examples

Minimal Configuration: This configuration would prepend my- to the beginning of generated utility classes, but would not modify css variable names:

$gorko-config: (
  'namespace': (
    'prefix': 'my-'
  )
)

Everything prefixed: This configuration applies the prefix to both utility classes and css variables:

$gorko-config: (
  'namespace': (
    'prefix': 'my-',
    'css-vars': true
  )
)

Separate prefixes: This configuration gives you the ability to provide different prefixes for utility classes and css variables:

$gorko-config: (
  'namespace': (
    'classes': 'my-class-',
    'css-vars': 'my-var-'
  )
)

Sass functions

There are a couple of handy functions that give you access to configuration settings.

Get color

get-color($key: string)

Takes the passed $key and attempts to retrieve a match from $gorko-colors.

Example

Using the default config:

$dark = get-color('dark'); // #1a1a1a

Get utility value

get-utility-value($key: string, $value-key: string)

Returns back the value for a utility class so you can use it directly.

Example

Using the default config:

font-weight: get-utility-value('weight', 'light'); // 300

Get size

get-size($ratio-key: string)

Tries to match the passed $ratio-key with the $gorko-size-scale. Returns null if it can’t find a match.

Example

Using the default config:

$my-size: get-size('500'); // 1.25rem

Sass mixins

Apply utility

apply-utility($key: string, $value-key: string)

Grab the property and value of one of the $gorko-config utilities that the generator will generate a class for.

Example

Using the default config:

.my-element {
  @include apply-utility('weight', 'bold'); // font-weight: bold;
}

Media query

media-query($key: string)

Pass in the key of one of your breakpoints set in $gorko-config['breakpoints'] and this mixin will generate the media query with your configured value.

Example

Using the default config:

.my-element {
  @include media-query('md') {
    background: goldenrod;
  }
}

Output:

@media (min-width: 48em) {
  .my-element {
    background: goldenrod;
  }
}

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
  2. Ensure your work is thoroughly tested, to the best of your abilities
  3. You may merge the Pull Request in once you have the sign-off from a maintainer

Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

Examples of behavior that contributes to creating a positive environment include:

  • Using welcoming and inclusive language
  • Being respectful of differing viewpoints and experiences
  • Gracefully accepting constructive criticism
  • Focusing on what is best for the community
  • Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

  • The use of sexualized language or imagery and unwelcome sexual attention or advances
  • Trolling, insulting/derogatory comments, and personal or political attacks
  • Public or private harassment
  • Publishing others' private information, such as a physical or electronic address, without explicit permission
  • Other conduct which could reasonably be considered inappropriate in a professional setting

Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

Attribution

This Code of Conduct is adapted from the Contributor Covenant, version 1.4, available at http://contributor-covenant.org/version/1/4

gorko's People

Contributors

andy-set-studio avatar bytelabsco avatar cristovaov avatar danielpost avatar joelcarr avatar paulsmithtrick14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gorko's Issues

Is Gorko still being developed?

Hi, and thank you for creating Gorko and so many other useful tools and writings to help us with our design.
I've recently stumbled upon your talks about CubeCSS while coming down from a Tailwind high, and in those talks you've been using Gorko.

I think this tool would fit our project quite well, but I've noticed that it hasn't received any commits in quite a while, and there are a few unanswered issues and pull requests.

Now this might be for many valid reasons.

  • Maybe you want to make changes but you're busy with other projects or - you know - paid work.

    In this case we would love to help out if that's possible.

  • Maybe you are actively using the tool but consider it fine as is and don't want to make any changes.

    In this case it would be lovely if you could comment on the PRs and issues (and maybe close them?) though, again, I'm not here to tell you what to do

  • Maybe you switched to different tooling and consider Gorko deprecated

    In this case I would love to know what tooling you switched to and how it's working for you, maybe we can adopt that as well.

I don't think every tool should have constant commits, especially if it's working fine, but when proposing Gorko for our project I do want to make sure that if something breaks down the line and we submit an issue or PR the answer is not "wait, you're still using this?!" 😅

Thanks for your time 🙂

Add support for in-demand utility generation

You can already tell Gorko not to render by setting $outputTokenCSS: false; when you pull Gorko in, but it'd be useful to enhance this with a supplemental renderUtilities() function/mixin.

Quite often, utilities need to have a higher specificity in projects and pulling them in at the end of a file gives them that source order boost.

Add support for themes

It's something that's going to be needed in this project I'm on and now #9 is merged, this is very doable.

I think it should run like this:

  1. Define a $themes map which contains colors fonts or whatnot
  2. During the generation of CSS: if $themes is defined and a utility uses CSS Custom Properties, use the $var-key to pick each map from each theme
  3. The theme should reference that its related to a user preference, such as @media (prefers-color-scheme: dark) or provide a namespace/prefix, so if someone adds say [data-theme="blush"] to the <html> element, it switches to that theme.

Example

Say we define something like this

$gorko-colors: ('primary': green, 'secondary': yellow);

$themes: (
  'dark': (
    'prefix': 'prefers-color-scheme',
    'tokens': (
      'color': ('primary': red, 'secondary': blue)
    )
  ),
  'blush': (
    'prefix': '[data-theme="blush"]',
    'tokens': (
      'color': ('primary': pink, 'secondary': purple)
    )
  )
);

The generator would generate this:

/* Default */
:root {
  --color-primary: green;
  --color-primary: yellow;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: red;
    --color-primary: blue;
  }
}

[data-theme="blush"] {
    --color-primary: pink;
    --color-primary: purple;
}

It needs to be as flexible as possible because that's the whole mantra of this project.

Gorko classes stripped by PurgeCSS

This is actually an issue with PurgeCSS but I wanted to post the problem and solution here in case others run across it.

PurgeCSS will ignore classes with a : in their name, which Gorko uses for its responsive class names. The solution I came across was to use the regex recommended in the Tailwind docs which is more permissive and looks for :, as well as some other special characters.

In your PurgeCSS config do:

defaultExtractor: content => {
  // Capture as liberally as possible, including things like `lg\:display-none`
  // https://tailwindcss.com/docs/controlling-file-size#understanding-the-regex
  return content.match(/[^<>"'`\s]*[^<>"'`\s:]/g) || [];
},

Support for @use?

I'm not super familiar with sass but I did see that @use is now the recommended way to pull in modules. However it seems to break Gorko 😞

I'm not sure how big of a change it would be to make a version of Gorko that works with @use but I wanted to file a feature request in case it's possible.

Deprecated syntax

Deprecation Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Will it be rewritten to the new demands?

Best way to use css custom properties with gorko?

I was trying to think of a way to use $gorko-colors to define custom properties. In addition, if someone calls get-color(), I'd like it to return the custom property, instead of the literal color value. This would avoid duplication in the CSS.

For example, if I have --color-light: #fff and some of my code is using that, but elsewhere I use a .bg-light class (that gorko generates) then I'd end up with this in my CSS:

.foo {
  color: var(--color-light) // #fff
}

.bg-light {
  background-color: #fff
}

Add `style` and `sass` keys to `package.json`

If package.json would contain

"style": "gorko.scss"
"sass": "gorko.scss"

then they could (depending on the build setup) be imported with @import '~gorko'; instead of @import 'node_modules/gorko/gorko.scss'; (or @import '~gorko/gorko.scss';)

Example where that is shown: https://symfonycasts.com/screencast/webpack-encore/css (relevant part starts at 2:37 min)
Also see https://stackoverflow.com/questions/32037150/style-field-in-package-json

Is there anything against it?

Issue with generate utility classes in 0.7.1

When using $generate-utility-classes: false; before importing gorko, the utility classes were still showing on my page.
I switched to 0.6.0 and using the same code it now removes the utility classes as expected.

It could be caused by #21

Can we make `output` optional, to save some keystrokes?

The 'output': 'standard' could be the default value. And, we can override with 'output': 'responsive' to generate responsive class names.

$gorko-config: (
  "bg": (
    'items': 'color',
    'css-vars': true,
    'output': 'standard', // 👋  'standard' ≈ 'default'
    'property': 'background-color'
  ),
  "breakpoints": (
    // ...
  )
);

Or, is there any specific reason it is kept mandatory? Like, to skip a generating a set when output is null.

Custom properties outputting twice

Hey there,

Not a big issue but I noticed that my CSS custom properties were outputting twice and I couldn't figure out why for a while.

After digging into some of the gorko code, I noticed that it's theme related. I'm not using themes, nor have any mention of it in my config.

I added an empty themes value to my $gorko-config and that seemed to do the trick.

Example:

$gorko-config: (
  "css-vars": (
    "themes": (),
    ...
    ),
),

Support for prefixes / 'namespaces'?

Is it possible to configure Gorko to prefix all of the utility classes it generates? For example, if I have a configuration like this:

$gorko-colors: (
  'dark': #1a1a1a,
  'light': #f3f3f3
);

$gorko-config: (
  'bg': (
    'items': $gorko-colors,
    'output': 'standard',
    'property': 'background'
  ),
  ...
)

I would like to be able to set a prefix (hopefully just once, and not setting it for each property), and have that be applied to all of the generated classes. If my prefix were 'my', then the above would result in something like:

.my-bg-dark {
  background: '#1a1a1a';
}

.my-bg-light {
  background: '#f3f3f3'
}

My use case is we are implementing a design system for our organization, but would like to allow for teams to leverage other css framework in addition. This would help prevent class name collision.

Issues with CSS Custom Property generation

Only when I used the new CSS var and theme stuff on an IRL project I noticed it messed up with:

  1. If you set $generate-utility-classes to false, it won't generate custom properties
  2. If you declare themes, it won't generate the other custom property blocks

7/10 bad testing on my part

How should the responsive parameter work ?

I’m not quite sure to understand how the 'output': 'responsive' is supposed to work. As for now, it seems that it only outputs the same value in the different breakpoints and I don’t understand why one would do this.
But maybe I missed something. If no, shouldn’t we be able to set something like this up :

$gorko-config: (
  ...,
  'text':(
    items:(
      '300': 0.75rem,
      '400': 1rem,
      md: (
        '300': 0.875rem,
      ),
      lg: (
        '400': 1.1rem,
      ),
    ),
    'output': 'responsive',
    'property': 'font-weight'
  ),
  'breakpoints': (
    'sm': '(min-width: 36em)',
    'md': '(min-width: 48em)',
    'lg': '(min-width: 62em)'
  )
)

I could work on a PR to include such a behavior (syntax from $gorko-config to discuss). What do you think about it ?

Design tokens

@hankchizljaw This isn't an issue, but a compliment.

I think one of the most underrated gems about Hylia was the use of design tokens which parsed JSON to SCSS. It would also turn out a simple styleguide page. And if you were managing Hylia with Forestry, Forestry would display the color tokens as swatches, not just hex codes.

It was perfect when utilizing something like Fractal.build would be overkill. It relied on your Stalfos – which looks like the fetus that partly evolved into Gorko.

Any plans on extending Gorko into a low-level design system?

Should 'show': 'inherit' be 'show': 'revert' ?

Hello !

Config files says :

'box': (
    'items': (
      'block': 'block',
      'flex': 'flex',
      'hide': 'none',
      'show': 'inherit'
    ),

inherit seems a bit risky since it depends from parent's value. In my opinion, revert would be safer.

Allow print media queries

Breakpoints have the mediatype hard coded to be screen. It is currently not possible to have a valid media query which references a different mediatype.

Removing that hard coding allows a breakpoint to be added like this

'breakpoints': (
  ... // as per existing
  'print': 'print'
)

making it easier to control the print layout.

I have a pull request ready (my first one ever!) for this change if there is any interest.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.