Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different column widths for different screen sizes #47

Closed
MWDelaney opened this Issue Oct 5, 2016 · 5 comments

Comments

Projects
None yet
3 participants
@MWDelaney
Copy link

MWDelaney commented Oct 5, 2016

Hello,
I often find myself needing to adjust column widths for the various responsive screen sizes I'm developing for. A quick-and-dirty example using Bootstrap classes might be as follows:

<section class="row">
    <article class="col-xs-12 col-sm-6 col-lg-8">
        Content goes here
    </article>
    <figure class="col-xs-12 col-sm-6 col-lg-4">
        <img src="image.png" class="img-responsive">
    </figure>
</section>

With Tailor I can only set the column widths once, and can't change them depending on the screen size. Am I missing something?

@andrew-worsfold

This comment has been minimized.

Copy link
Contributor

andrew-worsfold commented Oct 5, 2016

@MWDelaney -

Specifying mobile and tablet specific column widths like in Bootstrap is not currently possible. Bootstrap isn't used in the project, however I am interested in supporting something like this so long as it can be achieved without adversely affecting people who have no use for this level of control.

What you can do in Tailor at the moment:

  1. Specify custom classes for both rows and columns.
  2. Select the breakpoint at which columns collapse into a single column.

One factor to overcome is that columns in Tailor are added and resized using drag and drop. I'm putting together a free advanced extension for more advanced features that not everyone will be interested in to avoid "feature bloat" in the core plugin. Perhaps a couple of settings could be added through that to control the individual column widths on various screen sizes.

Interested to get your thoughts on what this could realistically look like in the context of Tailor.

@MWDelaney

This comment has been minimized.

Copy link
Author

MWDelaney commented Oct 5, 2016

Is it possible for the Tailor canvas to know which device preview "mode" you're currently in? Could the drag-to-resize columns (and classes) be set and saved per "device mode"?

That way you could set your column widths for desktop (a typical default view when working in Tailor) and then switch the view mode to tablet, resize the columns, and both settings would be saved. This way editing is always done in context with the device you're styling for, and doesn't add clutter to the settings screens.

The output would necessarily be something like Bootstrap's sm-6 md-8 classes but it would get the job done.

@andrew-worsfold

This comment has been minimized.

Copy link
Contributor

andrew-worsfold commented Oct 8, 2016

I like the idea, although suspect that it may suffer from some problems (e.g., dragging to resize collapsed columns). Responsive settings of this sort are planned to be part of an upcoming free extension, so I will put some thought into how this could/should work.

Really keen to get feedback from you (and anyone reading this)!

andrew-worsfold referenced this issue Nov 3, 2016

Tailor 1.7.4.
* Added - Nested rows and columns [GitHub 49](https://github.com/andrew-worsfold/tailor/issues/49) [Read more](https://medium.com/@tailorwp/columns-on-steroids-df5a5a957d89).
* Added - Tablet and mobile-specific widths for columns [GitHub 47](https://github.com/andrew-worsfold/tailor/issues/47) [Read more](https://medium.com/@tailorwp/columns-are-now-more-responsive-1e2cf793b11f).
* Improved - Appearance of element controls in preview window for narrow elements.
* Fixed - Responsive setting buttons appear over fields when the control title is too long [GitHub 67](https://github.com/andrew-worsfold/tailor/issues/67).
@andrew-worsfold

This comment has been minimized.

Copy link
Contributor

andrew-worsfold commented Nov 3, 2016

@MWDelaney -

Tailor 1.7.4 introduces both nested and responsive columns. Enjoy.

@reefki

This comment has been minimized.

Copy link
Contributor

reefki commented Dec 4, 2016

@andrew-worsfold Thanks for improve the column element that now uses percentage instead of 12 grid.

However I think it would be awesome if there is a field to manually enter the width because I have a little problem resizing the column using the mouse to get the exact width for example 1/3 column currently I get 33.4% which should be 33.3333333333%

I know it very tiny difference between 33.4% and 33.3333333333% but the displayed result quite make a big difference with 33.3333333333% I get 370px which is perfect pixel but with 33.4% I get only 369.45px, some of image inside becomes blurry because the column size is lower than 370px

Another benefit of adding column width field is ability to set different column widths on mobile and tablet. Now I take a sidebar as example I want to have a 1/3 (33.3333333333%) on desktop/tablet and I want to make it full width on mobile devices. Here is what I get currently:

Desktop
screen shot 2016-12-04 at 19 08 00

Tablet
screen shot 2016-12-04 at 19 07 46

Mobile
screen shot 2016-12-04 at 19 07 34

Look at the mobile view, the content is narrowed than the sidebar that looks a bit weird though. I know there is a visibility options which can be used to hide it on phones but that's not the point.

I look forward to hear your though on it.

EDIT: Forgot to mention that the mobile view is using 480px instead of 320px

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.