GitXplorerGitXplorer
H

css-sucks-2015

public
76 stars
5 forks
2 issues

Commits

List of commits on branch master.
Unverified
d684e25bc23d782049b2bc6437fd26f1eafddfce

upgrade to Reveal 3.3.0

HHuxpro committed 9 years ago
Unverified
107bfa12ad42c64636b308835cb5633f0ba9339f

patch my opinion part

HHuxpro committed 9 years ago
Unverified
67264b729e69e569fa7c0fe5fee43e167acc6b55

add Atomic CSS to README

HHuxpro committed 9 years ago
Unverified
d713521569a727bfeb124221d4b3d0defb8f9bbb

patch Atomic CSS part

HHuxpro committed 9 years ago
Unverified
d77b500161c57e2e4dce387f6dd054688ab9471a

2016 nodeparty modification

HHuxpro committed 9 years ago
Unverified
3354759359258bed925c8889cd6bd821d567fb2e

add gh-btns iframe

HHuxpro committed 9 years ago

README

The README file for this repository.

CSS Still Sucks 2015

(都 2015 年了,CSS 怎么还是这么糟糕)

Catalog

  • Document Times
    • Frameworks
    • Style Guide
      • OOCSS
      • SMACSS
    • Pre-processer
    • PostCSS
  • Application Times
    • Shadow DOM
    • CSS "4"
    • Naming Convention
      • BEM
      • SUIT
    • Atomic CSS
    • CSS in JS
    • CSS Modules
      • Interoperable CSS
    • PostCSS, again
  • My Opinionated Proposal
    • POCss

POCss: Page Override Components CSS

1. Scoping Components
CSS Blocks should only be used inside a component of the same name.

// Component/index.scss
.ComponentName {
    &--mofierName {}
    &__decendentName {
        &--modifierName {}
    }
    .isStateOfComponent {}
}
// Component/index.js
require('./index.scss');

CSS is always bundled with components
(from loading, mount to unmount)

2. Components can be Overrode by Pages
There is always requirements to rewrite styles of components in pages

// Pages/PageA.scss
#PageA {
    .pagelet-name {
        .pagelet-descendent-name {}
    }
    .ComponentName{ /* override */ }
}
// Pages/index.js
require('./PageA.scss');
  • #Page for absolutely scoping between pages
  • .pagelet-name should be lowercase to prevent conflicting with components

Why POC?

  • It's technology-agnostic
*One css framework can be played with whatever technology stacks*
*You can combined Scss, PostCSS and whatever you want*
  • Solving problems, and easy
*Makes reading and teamwork much easier*
*Get all benefit from BEM, SUITCSS and others*
  • Leverage the power of cascading properly
*Scoping components but allow reasonable overriding*
*It's pragmatic, flexible and hitting the sweet spot*

Thanks

Reveal.js