Code Monkey home page Code Monkey logo

Comments (3)

sherakama avatar sherakama commented on May 31, 2024

We can be opinionated as we want to be with these default variables. Our functions and mixins will require everything they need to work to be sent to them through a parameter. We will not include global variables in our functions and mix ins. This way we can create all the wonderful and sensible (to us) variable defaults and use them with our functions and mixins and other can send in theirs.

In the example I am putting together, I refactored the centered-section mixin to require just one section map to be passed through:

So in my work I can use the full, edge, or content maps by calling map-get on the $section variable or I could just create my own on the spot.
https://github.com/SU-SWS/decanter/pull/21/files#diff-26e546128596673c0548c127eedef129R11

I want to include a good deal of sensible and opinionated defaults in this library of work.

from decanter.

kgcreative avatar kgcreative commented on May 31, 2024

yeah, I like the way you are refactoring centered section. I'm in the middle of refactoring it again. That mixin needs to be split into two (following neat's convention of single-function mixins)

  1. centered-container -- this one you just pass it the settings raw
  2. responsive-container -- this one you pass a map.

I'm also refactoring the section maps to instead of having one giant nested map, you create one map per responsive set. This is less complex and works similarly to neat's grid-media mixin. Stay tuned.

As i've been working with neat a lot more, then only default global variable they consistently call is the $neat-grid; map, which is set by default, and is user overridable. I think that provides a default fallback that can be really nice, and something we can safely emulate

Stay tuned...

from decanter.

kgcreative avatar kgcreative commented on May 31, 2024

#23 Addresses all of the above.

by refactoring centered-section to centered-container i was able to remove all the cruft

with a much more targeted centered-container mixin, i was able to create a responsive-container mixin that simply consumes a map.

I thought about making responsive-container work similar to the color map, but in this instance, we want our responsive sections to ONLY output the custom sections we specify. So that simplified things even more.

from decanter.

Related Issues (20)

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.