mgechev / mgechev/angular2-style-guide

Suggestion: Add guides for component css styling to the styleguide

Open
#45 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1.2k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Was just thinking. In our project at work, we are playing with how to name components and how to use/name the css classes.

We were using [ITCSS](https://css-tricks.com/forums/topic/itcss-an-interesting-way-to-organize-large-scale-projects/) as a base for our css structure Kinda like BEM, SMACSS combined with some extra goodies.
It helps a lot with the lexical scope and stuff.
But when you're building components, your lexical scope is mostly gone and instead of using BEM classes to define your HTML structure you can use your component names (HTML elements) to define structure/make the HTML more readable.

But you're probably still gonna use global styles combined with component styles on your component, therefore it would be nice to see the difference between the two at once.

We thought this could be a nice solution:

Old bem style:

``` html


// .blue is a global class

header text


header text


lorem ipsum

```

So defining component style classes with a double dash prefix like: `--wide`. Since they are usually modifiers of the style of the component

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing styleguide structure and its guidance on component naming and CSS classes. Add a guide that clearly contrasts the shown BEM markup with component-style markup, explains global versus component styles, and documents the proposed double-dash modifier convention.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, css
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.