GithubHelp home page GithubHelp logo

maintainablecss.com's Introduction

MaintainableCSS.com

maintainablecss.com's People

Contributors

adamsilver avatar d2s 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

Watchers

 avatar

maintainablecss.com's Issues

MaintainableCSS as a PDF

Hello Adam,

I loved your webpage/book, but i found a little bit tedious that all chapters are different links with the index on the bottom.

I then created for myself a PDF version of your book.

MaintainableCSS.pdf

I suggest that you offer this PDF as a downloadable version on your webpage, and maybe an option to see the whole document as a long webpage.

I hope this was useful

Thank you.

[question] 10. Javascript: Classname instead globalState

When creating an element from a JS-Class, the current approach is to either use explicit module-class-names for every instance or absolute global state:

var module1Collapser = new Collapser(element1, {
  cssHideClass: 'moduleA-isHidden'
});

var module2Collapser = new Collapser(element2, {
  cssHideClass: 'moduleB-isHidden'
});
.moduleA-isHidden,
.moduleB-isHidden {
  display: none;
}
.globalState-isHidden {
  display: none;
}

But we already have a (JS) class name "Collapser", so the first thing I would concider is using that instead of global state.

/* selecting every "Collapser" instance that is hidden*/
.Collapser-isHidden {
  display: none;
}

/* if a specific Collapser-instance should look differnt */
.collapserA-isHidden {
  display: block;
  height: 0;
}

Question:

Are there any arguments agains JS-Class-name instead global state (assuming global state can be used for really everything)?

Proposal:

Replace .globalState with the js-class-name .Collapser.


The Javascript chapter sais:

[…] the global class will be referenced from within […] However, this approach doesn't always make sense. We may have two different modules that behave the same, but look different, which is something we've discussed in State.

In State:

[…] whilst states might be common, associated styles might not. For example, an empty basket has a gray background, where as an empty search has an absolutely-positioned image.
What about reusing state?
Sometimes, we may in fact want to reuse state across modules or components. For example, toggling an element's visibility. This is discussed in more detail in the chapter entitled Javascript.

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.