Comments (11)
Note: A slightly clearer article on BEM specifically in CSS: http://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
I've been thinking about how best to formalise this into a strict style we can use throughout.
I see the merits of BEM, chiefly that it's always immediately apparent where the element that a class is styling fits within the document hierarchy - you always know how each block, element and modifier relate to each other.
However, it does create a relatively rigid structure that is fiddly to alter down the line because blocks and elements are so bound together. For a very lean, iterative process, this feels more painful than useful for now.
I think we should use the modifier convention but we'll need to review the block__element
convention.
@msmichellegar @NataliaLKB, as two organised people who have experience of CSS, what do you reckon?
from start-here.
I feel BEM trades off flexibility for predictability. It reduces the burden of understanding css selector specificity so it can mean fewer surprises for teams all hacking on the same styles.
I don't enjoy working with BEM, but probably because I haven't fully let go of the (possibly just as harmful) dream of semantic mark-up. I'm most curious to see where this issue leads.
from start-here.
@olizilla Cheers for the thoughts, good to know!
from start-here.
Interesting! I've never heard of this before, but it looks very logical. I like your idea @iteles, of using modifiers, but reviewing block__element. I feel like it'd be good to be able to move elements around freely later down the line if we want to experiment with different UI/UX.
from start-here.
Still trialling this at #dwylsummer.
from start-here.
My view on BEM is that it will make no sense to you until you have worked on a very complex UI with a large team and experienced those pain points. Just like @iteles mentioned, it is very fidgety to alter and does not lend itself well to a "loose" process. You can end up having endless semantic arguments.
If you were working on a team that was asked to spend a year planning, designing, wire framing, and developing an entire redo of bbc.co.uk then it would likely be the teams best friend. I feel it works best in a very "waterfall" hierarchical type of setup.
from start-here.
Thanks for the input @howardroark 😊 Have you ever had the chance to use it yourself on a project?
from start-here.
Yes. It was actually quite enjoyable during the initial development stage. As @olizilla mentioned it is a nice stand-in for semantic markup while appeasing a complex UI design. It was not much fun after the client feedback started to roll-in and things needed to change quickly leading up to the deadline. A lot of what you were proud of becomes "undone".
I think it was conceived to compliment teams who are running and maintaining large marketing based sites that goes through planned periodic updates.
from start-here.
Really useful to get your take on this @howardroark, thanks!
We totally agree. Our style guide (in progress) currently states we use BEM modifiers but semantic markup otherwise and we very much feel that that's the right solution for us at the moment. Flexibility is key 👍
from start-here.
Added what's currently right for us to the style guide, as per comment above ➡️ dwyl/style-guide@dea0009?diff=split#diff-04c6e90faac2675aa89e2176d2eec7d8R83 👍
from start-here.
Though I am a bit late replying to this thread (as it is now closed) it is an interesting topic.
We use BEM at the guardian and I do see why it is done... It is predictable, and there aren't very many surprises, but I do find it can make our templates quite messy as class names get longer and longer. That said, since we have such a big site, it is very beneficial to have a clear picture of everything I am changing simply based on the name of the class.
In my next personal project (or with you guys) I would very much like to try using BEM modifiers potentially without the block__element
as I find that can result in repetition in the code which I would prefer to avoid.
The talk on BEM that happened yesterday at the London AJAX meetup was very informative, but didn't go in depth in the pros and cons of each approach. Here are the slides if you are interested.
from start-here.
Related Issues (20)
- .invite.me HOT 1
- I'm interested in joining dwyl .
- Invite Me
- An app can be a home-cooked meal
- Please invite me.
- SPIKE: Automatically invite `people` who ⭐ this repo HOT 4
- .invite.me
- Invite me please :D
- I would like to join this organization
- Request for joining organization
- Please invite me to your organization. HOT 1
- Harvard CS50 – Full Computer Science University Course
- The Perks of a High-Documentation, Low-Meeting Work Culture
- Want to join the Community.
- WANTED: People who are *Obsessed* with Personal Effectiveness 🙏
- Please invite to this community.
- Please invite me to the community HOT 3
- Want to join this organization!
- Want to join
- Invalid Gitter Link in Readme.md HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from start-here.