Giter Club home page Giter Club logo

getbem.github.io's People

Contributors

akashkumar7902 avatar aminagiger avatar andrepolischuk avatar blindlybright avatar code-warrior avatar drugoi avatar floatdrop avatar gitname avatar greyvugrin avatar gruzzilkin avatar guria avatar hawaiianchimp avatar iamstarkov avatar kinging123 avatar koomai avatar lukaszklis avatar mbarinov avatar mrabdurakhimov avatar nbkhope avatar ntzm avatar oscard0m avatar pandermatt avatar rektide avatar roman01la avatar sharils avatar sumnermic avatar tadatuta avatar varya avatar voischev avatar zuzusik 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  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

getbem.github.io's Issues

Minimal SEO optimization

Site should have

  • keywords on each page
  • description on each page
  • author on each page
  • approriate heading ierarchy
  • open graph meta tags
  • twitter card support

How do I know what a block should be?

In the Github example mockup you show that each of the 3 large input fields is a block. However, couldn't it be said that the form is a block and the input field therein are elements? How would BEM prevent one developer/designer from creating inputs-as-blocks and another developer/designer creating form-as-block-and-inputs-as-elements, or encourage them in the right way?

add 404 page

After last page movements we need to add proper 404 page

Introduction

This is discussion about Introduction article on site.

Main goal: Light interest in methodology, tell advantages and basics

Questions, that this article should resolve:

  • What problems should you expect, if you do not using structured CSS
  • Show, how this problems can be resolved with BEM
  • Add FAQ (will be own page - too many questions)
  • Put some examples of Blocks, Elements and Modifiers
  • Publish introduction on css-weekly (when it will be worth it)

I think these targets will help people to understand basics of BEM and sow some interest in methodology itself.

This article should have some pictures of sample site and it's blocks (it should be more visual, than textual article I think). Link to live demo will be good too.


Articles, that can be linked, or used as inspiration:


Must watch css videos

Should I define a variant or there's some better way?

I have two components:

.button {
  &--primary {
    color: red;
  }
  &--default {
    color: black;
  }
}

.header {
  background: black;
}

Now, my HTML is:

<header class=header>
  <button class="button button--default">
</header>

Inside my header, the default button will not be visible, because the background has the same color of the text.

I'd like to do something like this:

.header {
  background: black;
  &__button {
    color: white;
  }
}
<header class=header>
  <button class="header__button button button--default">
</header>

But it doesn't look so BEMish...

I think the other solution would be to define a variant of .button for just this specific case, but I wanted to check if there is some easier way for this specific case?

Thanks.

Change logo

I even did not realised that the strips in head are logo. I think there is no reason not to use and official BEM symbol at the front page. Let's take it. We can fulfil the symbol with any background we want.

Mixed case syntax

Other than familiarity, is there a reason BEM settled on the all lowercase syntax that was generally popular for non structured CSS naming conventions?

I'm not sure if there was a particular reason everyone settled on the all lowercase dash separated syntax other than lack of need for a more descriptive syntax, and a desire to match HTML conventions. But CSS is not HTML so is there a reason for them to match? Since BEM is much more descriptive, I like to use mixed case to provide more versatility.

Personally I've settled on BlockName_ElementName-attributeName using PascalCase/ camelCase to invoke a class/variable feel. IMO it's easier to read than block-name__element-name--attribute-name because each name token is blocked together. Also __ and -- look ugly :)

Is there a particular reason BEM settled on all lowercase instead of mixed case? Did I make a grave mistake, or is it purely cosmetic?

Block modifiers that effect elements

I'm not sure if & where this falls into the BEM methodology, but I'm interested in where this might fall.

If I have a block modifier, for example "xmas," and I want the elements within that block to also be xmas themed, how would it be best to do it.

Does a --xmas suffix for every element seem necessary? Or would this be the one use-case for nesting (e.g. block--xmas block__elem { ... }?

Let people to edit pages

Visitors can have ability to edit pages to fix typos and make improvements.

To reach this we should:

  • add fork us label
  • add edit link at the bottom of all pages taking user to github edit form

Styleup FAQ

We need nice quote style and short/long answer.

Make new footer

Let's make new footer with links to twitter and github accounts with appropriate buttons, like follow, star, fork and other

Redirect from index.html

If url ends with index.html, for example (/naming/index.html) - should we redirect user to /naming/ page?

Who uses BEM

If you or your company using BEM methodology, we will be happy add you logotype at getbem.com.

If you can add link to repository with build scripts or write a quote about How BEM make your life better - we will pick best ones and put them on site too.

Brazilian Portuguese Translation

Hi guys!
I'm a brazilian designer and developer and i'm currently looking to contribute on some open source projects. I stumbled across getbem and found the content to be super valuable, so i'm willing to translate it to portuguese, would it be ok?

naming element used in many blocks

I want to know. if there is an element that many blocks have used it.these blocks are block1,block2,block3... Then ,How should I name this element?

Class for repeating elements

Hi,

I'm using a table and I'd like all "td" to have a padding of "10px" and I don't want to use the "cellpadding" attribute of the table. In "normal" CSS, I would do something like :

td { padding:10px; }

But I'd like to use BEM. What I did so far is :

.my-table__col { padding:10px; }

It works, but it means that I have to put this class on every "td" element of my array, which produce a HTML bigger than wanted. Is it the only solution or can I use "tag" selector in BEM (I think I read that I shouldn't...).

Better build and deployment

It would be awesome to build in dist folder and publish only served files in gh-pages. I would like to avoid complicated build processes (like add gulp to move files around), but for start it will suffice.

Block Element Modifier - Element Modifier

I was wondering what would happen in the following instance. I couldn't seem to find an example anywhere. Also I've noticed the last two issues haven't been answered in over a month, is this still active?

<div class="intro">
    <span class="intro__span--title"></span>
    <span class="intro__span"></span>
    <span class="intro__span"></span>
</div>
.intro__span { display: block; }
.intro__span--title { font-size: 1.1em; }

Now the intro__span--title doesn't take on intro__span so do you have to do <span class="intro__span intro__span--title"></span>

Block Element Modifier - Element Modifier

Hey,

Noticed the last few questions haven't been answered in almost a month. Is this still active?

I was wondering what would be the correct way to do the following
html:
`




` **css:** `intro__span { display: block; } intro__span--title { font-size: 1.3em; }` intro__span--title doesn't take on intro__span so to do a modifier would you have to do the following? ``

Project goals

Hi all!

I want to start discussion about goals of getbem.com site and how we planning to achieve them.

"Get BEM" to all people in simplest way

(no matter what size of project are they working on)

To achieve this we trying to separate BEM methodology from concrete libraries and tools, which will decrease threshold of entry in methodology. It is quite obvious, that BEM can be separated into Naming, Structuring and Building steps. Each of those can be used separately and give benefits of structured project or BEM naming in single index.css file.

Those articles are in pretty bad state for now—they have no illustrations, weak examples and very-very short. So we are looking for authors which share our point of view, that can help us to write those articles.

What about bem.info?

We think, that bem.info have too many information and arcticles. Some of them are outdated, some of them are not translated to English. This leads to confusion and produces frustration, that associated with BEM methodology.

What about bem-tools and ENB?

Bem-tools and ENB are concrete build-systems with they own advantages and disadvantages. Otherwise, we are focused on providing clear build instructions (for CSS, JavaScript and templates) which can be implemented in any build-systems.

What about blocks’ libraries?

Concrete block libraries should be chosen and developed by project needs. There are not many ready to use blocks’ libraries out there, so we planning to provide instructions for developing and testing custom blocks libraries.

We think, that all this will help developers to create lots of great libraries for BEM community.

Extending base components and re-using them

I'm wondering how to re-use base components within other components. I created a linklist with base-styling and I'm reusing it as part of a larger component. Within the scope of this component, the linklist requires additional styling. Applying this styling, is it …

  • A) an element, because it's used within a component/block – makes it easier to scope component-related styles within the component
  • B) a modifier, because it extends the base styling – feels like it respects the idea of BEM more

Or is there an option C) it depends?

  • If the adjustments are one use-case only -> A
  • If they are global modifiers -> B
<div class="component">
   <ul class="linklist linklist--mod"> OR
   <ul class="linklist component__linklist">
      <li class="linklist__item"> … </li>
   </ul>
</div>
// file lists.less
.linklist {
   …
   &__item {
   }

   // B)
   &--mod {
   }
}

// file component.less
.component {
   …

   // A)
   &__linklist {
   }
}

Block modifier affecting sub-block elements

Hi.

I have a quite complicated and very specific situation. I found a "fix" but I don't like it. So I will explain it step by step to the "fix" I found. I hope you will be able to purpose to me something better :)

I have the following CSS and HTML:

.my-block.myblock--modifier .myblock__element { ... }
my-block my-block--modifier
  my-block__element /* affected */
    my-block
      my-block__element /* affected but unexpected */

With the --modifier which should affect __element. The problem is that the sub-block element is affected too by the --modifier.

Two solutions:
1. Direct nesting block and element Beurk, dirty

.my-block.myblock--modifier > .myblock__element { ... }

2. Add modifier class on element

.myblock--modifier { ... }
.myblock--modifier__element { ... }
my-block my-block--modifier
  my-block__element my-block--modifier__element
    my-block
      my-block__element /* not affected */

But.
2.1. Can we consider than a block encapsulates its elements ? If yes, we shouldn't care that the block --modifier is affecting __element. A solution can be to always apply modifier on elements too, regardless if its modifier is affecting it or not. It's hard to write but maybe it can be automated on JS frameworks.

2.2. I'm working on a semantic SCSS, with something like this:

@mixin my-block--modifier {
  /* will generate .header__my-block .my-block__element */
  .my-block__element { ... }
}

...

.header {
  /* this header element is called as the block because we assume it is this block */
  &__my-block {
    /* modifier applied with @include so it can be applied for a particular breakpoint */
    @include my-block--modifier;
  }
}
header
  header__my-block my-block
    my-block__element
      my-block
        my-block__element /* affected */

To resolve this situation as I done at 2, I can do :

@mixin my-block--modifier {
  /* will generate .header__my-block__element */
  &__element { ... }
}
...
header
  header__my-block my-block
    header__my-block__element my-block__element
      my-block
        my-block__element /* not affected */

But it create a lot of long classes to apply, with the same 2.1 problem. *header__my-block__... will have to be applied on each element.

Can you advise me better practices ? I tried to numerate my questions and problems so you can give step-by-step responses :)

I'm working on https://github.com/ncoden/caliopen.web-client-ng/tree/refactor/foundation . Take a look if you want to see what give a semantic SCSS on a medium-big project

Can I use element of block #1 inside block #2 which in turn is inside in block#1?

For instance:

<div class="post__header">
    <div class="user-card">
        <div class="user-card__userpic">
            <img class="userpic userpic_type_round".../>
        </div>
        <div class="user-card__text">
            <span class="user-card__username">User Name</span>

            <!-- here. it's ok? -->
            <span class="post__meta">2 hours ago</span>

        </div>
    </div>
</div>

Or just do not worry and do all these things as elements of appropriate blocks?
issue

Add how-to rebase/move images while building CSS to docs

If I building the project from BEM-like filestructure — all images are in their block's folders. I think it is another block technology. So I should move images to some ./assets/images/ folder and rebase url's in CSS.

How do you manage your image files?

I think it can be good to have a note about this issue in build docs. Thanks.

Does BEM extend to ids?

What is the recommendation for id naming? I would assume that an id (#) would have the same rules as a block, but is BEM intended only for class naming and not ids?

Global component theming issue

I have this LESS:

.foo-bar {
  &__el1 {
    height: 10px;
  }
  &__el2 {
    height: 15px;
  }
  &__el3 {
    height: 10px;
  }
}

now... I want to add some theming variations to it:

.foo-bar {
  &--sm {
    // here something to change the height of my 3 elements...
  }
  [...]
}

Obviously I don't want to apply the --sm variation to each element of my component, but I want to add it just to the component and changing the rest accordingly.

How to proceed?
Should I repeat all the elements name by hand?
Doing so, when I want to rename a component, I'll have to manually rename all of them.

.foo-bar {
  &--sm {
    .foo-bar__el1 {
      height: 5px;
     }
     [...]
   }
}

BEM Blog

@f0rmat1k proposed awesome idea - start to write blog posts about BEM and different ways of building it with vary of tools.

If you are interested in creating glorious blog - write us! We will be happy to roll out http://blog.getbem.com site.

Visual Hierarchy on Naming Page

Hi -- apologies for just jumping in as a stranger. But as an information and UX designer, I was interested in learning about BEM but then very confused by the Naming page. The problem is that you seem to have a conceptual hierarchy (top level: Block, Element, Modifier; each has lower levels of Naming, HTML, CSS) but the top level names are presented at the same font size as the lower levels -- plus, the colorizing of the top level names with different colors works against the principles of gestalt theory, which show that humans group things of the same color, separate things of different colors.

Possible solution: bump the Naming, HTML, and CSS down to

, set Block, Element, and Modifier to the same color (doesn't have to be the same color as the body text!).

Add follow up material

It would be nice to have list of links to additional materials, that could help beginners to start making sites.

Migrate to react-router

For now we have half-working hot reload, because of /introduction/index.html files - webpack-dev-server is not doing magic on them (only on index.html).

Using react-router will fix this, but urls will be a bit different.

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.