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

Annotation @flag not allowed for type Molecule #46

Open
harapeko opened this issue Feb 27, 2017 · 2 comments
Open

Annotation @flag not allowed for type Molecule #46

harapeko opened this issue Feb 27, 2017 · 2 comments

Comments

@harapeko
Copy link
Contributor

harapeko commented Feb 27, 2017

nucleus-styleguide: 1.1.0
node: 5.5.0
npm: 4.0.3

It seems like @flag supported for @molecule on Reference.
Substitutions & Flags

/**
 * A menu bar which spans across full page width.
 *
 * @molecule Menu Bar
 * @flag full-width
 * @markup
 *   <nav class="menu">
 *     @{include:.menu-item}
 *     @{include:.menu-item}
 *     @{include:.menu-item}
 *   </nav>
 */
.menu { /* ... */ }

The following example

/**
 * @molecule global-nav
 * @flag full-width
 */

results in the following warning:

 Take care! Annotation @flag not allowed for type Molecule of .global-nav in resources/assets/pc/sass/_components.global-nav.scss
 Valid annotations are @molecule, @section, @description, @modifiers, @markup,
 @deprecated, @script. This element will not appear in the final StyleGuide
 until you fix this error.

I also peeked into Molecule.js in master and it also doesn't seem to support this:

this.fillable = ['molecule', 'section', 'description', 'modifiers', 'markup', 'deprecated','script'];

Sholud i use @structure ?
relate issue

@ryanhyslop
Copy link

I believe this may be by design, having ran into this issue myself I think it makes sense how it is. A molecule is a smaller unit that can be included in other molecules and structures. If a molecule needs a full page width then its not very reusable.

In your case I think the nav may well be fine as a molecule but you'd have a @structure for a masthead or header area that includes the navigation ( and possibly a logo etc) that goes full width?

Guess its all pretty subjective but that direction seems to work well for me.

@harapeko
Copy link
Contributor Author

I convince it.
In that case, it may be a reference that is misstake.

Substitutions & Flags

/**
 * A menu bar which spans across full page width.
 *
 * @molecule Menu Bar
 * @flag full-width
 * @markup
 *   <nav class="menu">
 *     @{include:.menu-item}
 *     @{include:.menu-item}
 *     @{include:.menu-item}
 *   </nav>
 */
.menu { /* ... */ }

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

No branches or pull requests

2 participants