question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Support for Carbon Grid layout

See original GitHub issue

Question about how to support the Carbon Grid layout using Angular componentry?

Detailed description

We are starting to use the Carbon Grid layout in our code and have been experimenting with create Angular components to abstract away the details.

Currently you would add markup like this to your template:

<div class="bx--grid">
  <div class="bx--row">
    <div class="bx--offset-xs-2 bx--col-xs-10 bx--col-md-5">Some content here</div>
  </div>
</div>

This is rather verbose and difficult to write so we have created some components that reduces this to the following:

<ibm-grid>
  <ibm-row>
    <ibm-column offset="{xs:2}" col="{xs:10, md:5}">Some content here</ibm-column>
  </ibm-row>
</ibm-grid>

For the case where no breakpoint needs to be specified could look like this:

<ibm-grid>
  <ibm-row>
    <ibm-column offset="2" col="2">Some content here</ibm-column>
  </ibm-row>
</ibm-grid>

This would only work if we don’t need to support break points and no break points at the same time. Not sure if this will always be the case.

So we wanted to get your feedback on this approach and your guidance on the best way to proceed.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
markewallacecommented, Sep 7, 2018

@zvonimirfras thanks for the suggestions, we will try out that approach. If it works out we can open a PR to see if it’s something worth adding to the library.

0reactions
zvonimirfrascommented, Sep 18, 2018

That is accurate, Stan, we used it in multiple places. Thing is, with components, you need something in the template, so that something bloats the DOM if you don’t need it. Directives don’t have that limitation. You can also apply directives to other tags so technically you could apply layouts to other components. You can’t do that if layouts are done with components.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Question] Support for Carbon Grid layout #47 - GitHub
Question about how to support the Carbon Grid layout using Angular componentry? Detailed description We are starting to use the Carbon Grid ...
Read more >
2x Grid - Carbon Design System
The IBM 2x Grid system is a fully responsive, robust, 16 column layout system with five default breakpoints and dozens of predefined classes....
Read more >
Does Conjointly support grid type questions?
While grid-type questions are commonly used in web surveys, Conjointly does not currently support them without the use of a customisation.
Read more >
eGRID Questions and Answers | US EPA
eGRID data can be used to support the following activities: ... Carbon Sequestration Database and Geographic Information System (NATCARB), ...
Read more >
IBM Design Language
The IBM Design Language provides the guidance and assets used to express the IBM brand in products, ... grid of ibm colors ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found