Giter Site home page Giter Site logo

Ordering objects in a Category about hologram HOT 8 CLOSED

stinoga avatar stinoga commented on September 10, 2024
Ordering objects in a Category

from hologram.

Comments (8)

aflanagan avatar aflanagan commented on September 10, 2024

Hmm...reverse alphabetical order? That's surprising, the default should be alphabetical based on the name you give each component.

As of now there is no standardized way to override the order. There was one section of a guide I made where I had to control the order a little differently. I hacked it by prepending a number to each name (e.g. 1_button_sizes) to have better control. Not great, but works for small sections.

from hologram.

stinoga avatar stinoga commented on September 10, 2024

Thanks @aflanagan. Just curious, what would you see as the best way to accomplish ordering? A name/value pair in the YAML comments?

from hologram.

jdcantrell avatar jdcantrell commented on September 10, 2024

We currently do it this way:

/*doc
---
title: Buttons
name: 00_button
category: Base CSS
---

if you remove the numbers on the name it should order alphabetically. If you leave the numbers then you can manually order your components by setting the numbers to different values.

from hologram.

aflanagan avatar aflanagan commented on September 10, 2024

Yeah, I think that is just as easy (or easier) than adding an optional sort key to the yaml config block. What do you guys think?

from hologram.

stinoga avatar stinoga commented on September 10, 2024

I'm cool with that. I'll close this out. Thanks gents!

from hologram.

VinSpee avatar VinSpee commented on September 10, 2024

Running into this as well. Ordinal naming can become a pain for maintenance. I'd love to have it at least respect import order:

@import elements/buttons/buttons
@import elements/buttons/base-button
@import elements/buttons/minor-button
@import elements/buttons/save-button
@import elements/buttons/close-button
@import elements/forms/input-labels
@import elements/forms/text-inputs
@import elements/forms/radio-inputs
@import elements/forms/checkbox-inputs

would output in the same order, ideally.

from hologram.

jdcantrell avatar jdcantrell commented on September 10, 2024

@VinSpee you should be able to get that ordering by default if you run hologram on your generated css instead of the sass files. I think in that case you would want to avoid using the name attr (which might mean you have to use the git version of hologram until the next gem update)

from hologram.

VinSpee avatar VinSpee commented on September 10, 2024

Since I use sass-style (//comment) comments, I’m pretty sure that’s a no-go, as they’re stripped from output.

-- 
Vince Speelman
Sent with Airmail

On May 1, 2014 at 2:22:54 PM, JD Cantrell ([email protected]) wrote:

@VinSpee you should be able to get that ordering by default if you run hologram on your generated css instead of the sass files. I think in that case you would want to avoid using the name attr (which might mean you have to use the git version of hologram until the next gem update)


Reply to this email directly or view it on GitHub.

from hologram.

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.