0.0.1 • Published 6 years ago

@nirbos/mark v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Mark is a small SASS package that helps you find elements you previously marked in your styles.

Installation

Mark is available via npm or yarn.

npm install @nirbos/mark
# or
yarn add @nirbos/mark

After installing, simply reference Mark in your scss file.

@import '_mark.scss';

Configuration

Unless changes are made to the configuration, the Mark default configuration is used.

OptionDefault
"mark""silent"
"silent-parent"".dev:root"
"container""&:after"
"text""marked"
$mark-settings: (
    "mark": false,
    "silent-parent": ".dev:root",
    "container": "&:after",
    "text": "marked"
) !default;

Options

There are four possible options: mark, silent-parent, container and text.

OptionValuesDescriptionDefault
"mark"true / false / "silent"The visibility of the marks."silent"
"silent-parent"stringThis is the element that has to have the current marked element as a child for it to turn visible. All CSS selectors are possible.".dev:root"
"container"stringThis is the pseudo-element which gets used to render the mark to the current element."&:after"
"text"stringThe content of the mark."marked"

Mark

"mark" has three possible options: true, false and "silent".

OptionDescription
trueAll marks are visible everywhere in the document.
false *No mark is rendered.
"silent"All marks are rendered, but remain hidden. If the current element is a child of silent-parent, this turned visible. The main purpose of silent is testing.

* Everything besides "silent" and true as a parameter for mark will simply be ignored, the mark will not get rendered.

Using Mark in your Styles

You can override the default configuration by making your own Mark settings:

$mark-settings: (
    "mark": true,
    "silent-parent": "body.dev",
    "container": "&:before",
    "text": "I'm marked"
) !global;

If you want to use the Mark default settings, or have them already customized to your likings, simply use the Mark mixin to mark an element.

.navigation {
    @include mark;
}

Besides overriding the configuration by resetting mark-settings it is also possible to customize specific calls for specific elements of your code.

.footer {
    @include mark( $text: "I will not only be marked, but will also ignore the mark-settings", $mark: true );
}

All of the four options mark, silent-parent, container and text are possible. When using them when including the mixin, you have to put a $ right in front of them.