Giter Club home page Giter Club logo

Comments (5)

hellohynes avatar hellohynes commented on August 20, 2024 2

Instead s-table__simple maybe explore classes that undid specific things, i.e. s-table__borderless removes all borders.

from stacks.

TedGoas avatar TedGoas commented on August 20, 2024

@hellohynes @aaronshekey @UXPiper I created a branch for this... couple questions before I start.

  1. Should we add this on to the existing tables page? I think yes, but am open if you think it should be it's own component.

  2. What should we call these more complex tables?
    [ ] Dashboard table
    [ ] Data table (well all tables are data tables)
    [ ] Complex table
    [ ] something else

from stacks.

aaronshekey avatar aaronshekey commented on August 20, 2024

I think that the default table could be the complex table, and we switch the barebones to a modifier that strips those things. s-table looks like those complex tables, and then s-table s-table__simple is just that, simple.

from stacks.

UXPiper-zz avatar UXPiper-zz commented on August 20, 2024

Adding code that I worked on to help replicate the complex code design. Hoping it's some assistance to @TedGoas

<table class="s-table bc-black-2 mt12 s-table__bordered fc-black-700">
            <thead class="bg-black-025 bt bc-black-2 fs-category">
                <tr>
                    <th scope="col" class="bc-black-2">@_s("Source")</th>
                    <th scope="col" class="bc-black-2" colspan="2">@_s("Job listing visits")</th>
                    <th scope="col" class="bc-black-2" colspan="2">@_s("% of total")</th>
                </tr>
            </thead>
            <tbody>
                @{ var maxClicks = Model.Referrers.Max(r => r.ClickCount);}
                @foreach (var referrer in Model.Referrers)
                {
                    var percentage = 100 * referrer.ClickCount / maxClicks;
                    <tr>
                        <td scope="row">@(string.IsNullOrEmpty(referrer.Url) ? _s("Direct URL or no referrer specified") : referrer.Url)</td>
                        <td class="ta-right brw0">@Localize.Numbers.CommaSeparated(referrer.ClickCount)</td>
                        <td class="va-middle blw0" width="116">
                            <div class="s-progress bg-white" id="brandprogress">
                                <div class="s-progress--bar bg-powder-400" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="@percentage" style="width: @percentage%"></div>
                            </div>
                        </td>
                        <td class="ta-right brw0 pr0">@Localize.Numbers.Percentage(referrer.Percentage)</td>
                        <td class="ps-relative blw0" width="38"><span class="d-inline-block ps-absolute" style="height:28px; width:28px; top: -2px;"><canvas class="js-pie-chart" data-percentage="@((int)Math.Ceiling(referrer.Percentage * 100))"></canvas></span></td>
                    </tr>
                }
            </tbody>
        </table>

This removes borders between numbers and graphs.
I also had to do some absolute positioning for the stupid chart.js pie charts that came in with an extra wide canvas that I couldn't seem to trim down.

Preview of table:
screen shot 2018-08-07 at 3 06 49 pm

from stacks.

TedGoas avatar TedGoas commented on August 20, 2024

TBH I misread the comments above and started building classes on top of .s-table instead of making .s-table The New Default and creating classes to undo things for simpler tables. My bad. I'll re-organized what I've done so far.

I did a quick search on Core for .s-table and found about 20-30 instances (and much of it looks recent), so I agree it's safe to change the default without worry too much about breaking something in the wild.

from stacks.

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.