Configuration

circle-info

Asterix's configuration is made of two parts.

$asterix-conf configures the asterix's settings ;

$asterix-vars injects your own design system settings into Asterix. Go to section "Variables" for more details.

Default values

$asterix-conf: (
  grid-columns-number: 12,
  media-queries-default-media: all,
  scope-vars-in-each-layout: true,
  specifiers-default-attribute: data-spe,
  verbose: false
) !default;

Retrieve configuration

You can retrieve configuration setting with the --conf($property) function.

@if(--conf(verbose)){
    @warn 'I am verbose.';
}

Update configuration

The mixin --update-conf($updatedConf) will merge the map you provide with the current settings.

circle-exclamation

Parameters

chevron-rightgrid-columns-numberhashtag

Define the maximal number of colums you're going to use in your layouts.

Because important loops are run from this value, you should always consider having a minimal number of columns.

default: 12;

Keep also in mind that this value is only concerning grid layouts, and can be set to 0 if you're going to use only flex layouts.

chevron-rightmedia-queries-default-mediahashtag

Indicate the media used into --mq() built media queries.

Default: all

chevron-rightscope-vars-in-each-layouthashtag

Boolean defining if asterix's internal css variables should be resetted each time a selector is declared, or if they should be declared only on the asterix's root level.

This allows to prevent any inheritance in the DOM tree.

default: true;

When set to false, be sure to initialize asterix inside of a selector. Variables will indeed be initialized at this element level, and css variable cannot be initialized at top level.

chevron-rightspecifiers-default-attributehashtag

default: data-spe

Globally set the attribute used to attach custom specifiers to.

chevron-rightverbosehashtag

In some case, Asterix can output warnings into the console, especially with --mq() mixin, when verbose is set to true.

default : false;

Last updated