The following is a guest post by Pieter Biesemans. Pieter is a front-end developer at Audience where he loves styling things with SCSS. He's going to dig into what I'd call a bonafide CSS trick.

The web is a rather vertical place. You read a web site like you read a physical page: left to right, top to bottom. But sometimes, you want to step away from the verticality of it all and do something crazy: make a horizontal list. Or even crazier, a horizontal site!

I’d be nice if we could do something like this:

/* This isn't real */
div {
  scroll-direction: horizontal;
}

Unfortunately, that’s not going to happen. It’s not even on the roadmap for CSS.

That's too bad, as at the company I work for this would be quite useful. We do quite a few web presentations. Presentations are a very horizontal thing - usually slides have a 4:3 or 16:9 radius. This means we always have a struggle between the horizontality of presentations and the verticality of web technologies. And by we, I mean me. But if there’s one thing I like, it’s a challenge.

Another Use Case

The specific use case that led to me digging into this idea that a customer wanted to show all their products on a single slide. Of course, their product catalog was way too big to put in a single view. So we decided to split them up into three categories, each horizontally scrollable. So the three most prominent product in each category were visible and less important products were still easily accessible.

A Non-JavaScript Way

There are, no surprise, numerous ways to do this in JavaScript. Some of them are on this very site.

I was curious if it was possible to do in pure CSS. The solution ended up being fairly straightforward:

  • Create a container with items
  • Rotate the container 90 degrees counterclockwise so the bottom is to the right
  • Rotate the items back to correct-side up

Step 1) Set up the container

Make a <div>, and make a bunch of child elements.

In this example, our side-scrolling container will be 300px wide, with 8 items of 100×100px each. These are arbitrary sizes; they could be anything.

<div class="horizontal-scroll-wrapper squares">
  <div>item 1</div>
  <div>item 2</div>
  <div>item 3</div>
  <div>item 4</div>
  <div>item 5</div>
  <div>item 6</div>
  <div>item 7</div>
  <div>item 8</div>
</div>

The height of the container will become the "width" and vice-versa. So below, the "width" of our container will be 300px:

.horizontal-scroll-wrapper {
  width: 100px;
  height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

Now the children:

.horizontal-scroll-wrapper > div {
  width: 100px;
  height: 100px;
}

Step 2) Rotating the container

Now we rotate the container -90 degrees with a CSS transform. And there you have it: a horizontal scroller.

.horizontal-scroll-wrapper {
  ...
  transform: rotate(-90deg);
  transform-origin: right top;
}

There’s just one tiny issue: our children have rotated too, and now anything within is on its side.

Step 3) Rotate the children back upright

How would we go about getting the children upright again? Rotate them back using another, opposite CSS transform.

.horizontal-scroll-wrapper > div {
  ...
  transform: rotate(90deg);
  transform-origin: right top;
}

Step 4) Fixing the positioning

It’s starting to look alright, but there are still some issues.

By rotating the wrapper using the top right as an anchor point, our left side has shifted by the width of the container. If you find this difficult to understand, just put your finger on the top right corner of a page and rotate it. The solution: shift it back with translateY.

Better. But the first item is still missing, due to the same phenomenon happening to the items. We could fix this by giving the first child a top margin of its width or by translating all items the same way we did the wrapper. The easiest way I’ve found though is to add a top padding to the wrapper equal to the item width, creating a kind of buffer for the items.

.horizontal-scroll-wrapper {
  ...
  transform:rotate(-90deg) translateY(-100px);
  ...
}

Demo

See the Pen Horizontal scroll (simple example) by Pieter Biesemans (@pieter-biesemans) on CodePen.

Here's another where you can see non-square children:

See the Pen Horizontal scroll (extensive example) by Pieter Biesemans (@pieter-biesemans) on CodePen.

Compatibility

I have tested on the devices immediately available to me.

Device OS Browser works?
Desktop Win10 Chrome 54 Y
Desktop Win10 Firefox 47 Y (w scrollbars)
Desktop Win10 IE11 Y (w scrollbars)
Desktop Win10 Opera 41 Y
Desktop Win10 Vivaldi 1.4 Y
Laptop (touch screen) Win10 Chrome 54 N
Samsung Galaxy S3 Android 4.3 Chrome Mobile 52 Y
Samsung Galaxy S6 Android 5.0 Chrome Mobile 52 Y
Nexus 6P Android 6 Chrome Mobile 52 Y
iPad2 iOS Chrome Mobile 52 N
iPad2 iOS Safari Mobile 9.0 N
iPad Air 2 iOS Safari Mobile 9.0 N

Desktop

Since the styling of scrollbars is currently only supported by WebKit/Blink, Firefox and IE still show the ugly gray ones. You could sniff this out with JavaScript and hide them completely, but that’s stuff for another tutorial.

Using the mouse scroll wheel works great on desktops. My laptop was a different matter, though. Both the touchscreen and the touchpad acted as though the div was not rotated.

Mobile

I was kind of surprised to find that Android actually understood that the container had been rotated, and let you scroll sideways by swiping left and right.

iOS on the other hand did not play nice. It acted like the container did not get rotated, so you have to swipe up and down to scroll sideways, which of course is counterintuitive. Also, swiping left and right moves the items up and down in their wrapper, which is unexpected and weird. Setting the overflow to hidden does not alleviate this issue.

Conclusion

According to Can I Use, CSS transforms are currently supported by over 93% of users (at the time of this writing, November 2016), so there’s no issue there.

Beware of using this in production, though. I have tested this on some devices, but not at all extensively or in depth.

The greatest issue is with touch inputs that requiring you to swipe up and down to go left and right. A possible solution would be to include a message on your site explaining this, but you’d have to rely on people actually reading your message. And even then it’d still be counterintuitive. Another possible solution would be to capture the touch input with JavaScript on those devices, but then you’d be better off just doing the whole thing in JavaScript and foregoing this CSS hack completely.

Pure CSS Horizontal Scrolling is a post from CSS-Tricks

Nextcloud has been making steady progress, with our Windows Mobile client and the CalDAV Outlook Synchronizer merely the last in a long list of great things coming from our community. Nextcloud 11 Beta is ready for testing, introducing many great features, showing how active our development is.
nc-weekly

Statistics

Looking at Github Pulse of last week above you can see that in the 7 days before we wrote this blog, Nextcloud merged an impressive 239 commits to the server code*! To not just look at numbers in a vacuum, we compare with other open source file sync and share solutions:

comparison-monthly-logos
Nextcloud, Pydio, Seafile and ownCloud

Nextcloud has 5 developers with over 50 commits last month, 2 even over 100. Those who know the company will see four of these five are employees of Nextcloud GmbH, the fifth being the super-active community contributor John Molakvoæ. With 17 engineers on the payroll, the company employs 9 of the top ten contributors in the last half year but it isn’t all about one month, so let’s look a bit further.

Commit graph

Here’s a graph of the development the last year, this time with the other projects below.

three-commits-comparison-logos
Top is Nextcloud, below are ownCloud, Pydio and Seafile. The last two were resized to scale.

Nextcloud had a super active week last week, as we had a hackweek just before feature freeze! You can see that Pydio has a rather cyclical development with periods of greater activity followed by less activity. According to the Pydio team (who we’ve asked) their contribution cycles are “not really a pre-established sprint, but more a natural “new major features > bugfixes > community feedback > specs for next features” cycle”. We would guess that the activity pattern in the other two projects probably has to do with the forks (EDIT: see the comments below from a Seafile developer – the German part of the fork did not contribute to the code so it made no difference; moreover, the statistics are skewed against seafile due to how they work).

OpenHub

There is a caveat with the statistics from the Server repository – a lot of work is happening in other repositories in the Nextcloud project. openHub shows statistics from an entire project and while not entirely accurate either (it is hard to keep track of all the repositories being added all the time to Nextcloud) it shows we’re doing really well! Here are the commit (until November 15) and contributor graphs (until October). You see the trends visible on github here, too – Nextcloud growing fast since its inception, with a great boost in the last 3 months.

openhub-comparison-commits-logos
Nextcloud, ownCloud, Pydio and Seafile with a 5 year graph.

We’re especially happy with this spike in new contributors:
openhub-comparison-contributors-logos

All this is of course entirely thanks to our awesome community of contributors, users and customers who have been active and involved in making Nextcloud a super secure, easy to use way to sync and share files, contacts, calendars and more. It shows what an open, collaborative project can do! Want to get involved? We just released a beta of Nextcloud 11, check it out!

* All according to statistics on Github and OpenHub. All stats screenshotted on November 21 or 22, links there so you can compare for yourself. Note that not all commits are equal. Some change one line, others introduce whole features! Equally, pull requests can add a big feature or fix a one-line bug, or just backport the same code to an earlier release to fix a bug. In general, don’t take statistics as gospel but compare multiple numbers yourself to get an idea of what is really going on. Also, of course all trademarks belong to their respective owners and being mentioned here means in no way an endorsement for us of them or from them of us!

BND-Zentrale in Berlin. Foto: CC-BY-NC-SA 2.0 Andreas Levers

BND-Zentrale in Berlin. Foto: CC-BY-NC-SA 2.0 Andreas Levers

In den vergangenen zwei Jahren hat die Bundesregierung Massenüberwachung massiv ausgebaut. Wir kommen kaum noch nach, die vielen unterschiedlichen Programme und Gesetzesprozesse ausreichend zu dokumentieren, in denen Grundrechte beschnitten und Überwachungsinfrastruktur ausgebaut wird.

Während sich die Bundesregierung hinstellt und bei jeder Gelegenheit betont, an den Grundfesten der Kryptopolitik werde sich nichts ändern und in der Digitalen Agenda das Versprechen ausgegeben wurde, Deutschland werde zum „Verschlüsselungsstandort Nummer 1“, sieht die Realität ganz anders aus. Anstatt konkret Verschlüsselung über Lippenbekenntnisse hinaus zu fördern, wird mit ZITIS eine neue Behörde aufgebaut, die mit bis zu 400 Beamten Wege gegen Verschlüsselung finden soll. Die heute von uns dokumentierten zusätzlichen 150 Millionen Euro für den BND sind ein weiteres Puzzle-Stück in der „Verschlüsselungsstrategie“.

Der BND soll 150 Millionen Euro Steuergelder bekommen, um damit im Namen der Sicherheit massive Unsicherheit zu schaffen. Während die Bundesregierung die Bedeutung von IT-Sicherheit erkennt und dazu Strategien entwickelt, soll der Geheimdienst nach Sicherheitslücken suchen, diese auf Schwarzmärkten kaufen und anwenden. Jede Sicherheitslücke, die nicht geschlossen wird, bleibt aber für viele andere nutzbar: für fremde Geheimdienste, für Wirtschaftsspionage und für andere Kriminelle. Sicherer wird unsere digitale Welt mit einer solchen Strategie nicht.

Es ist spätestens seit 2009 bekannt, dass der BND tausendfach fremde Rechner hackt. Aber wir brauchen eine gesellschaftliche Debatte über unsere staatlichen Organe. Und eine informierte Öffentlichkeit braucht dazu Informationen. Vor allem, wenn wie in der Kryptopolitik die öffentliche Verlautbarungen anders klingen als das, wofür dann im Geheimen Haushaltsgelder bereit gestellt werden.

Wir brauchen eine öffentliche Debatte über die Krypto- und IT-Sicherheitspolitik der Bundesregierung

Wir haben uns außerdem strafrechtlich beraten lassen und sind daher sicher, dass unsere Arbeit legal ist. Denn wir handeln gerade nicht mit dem Ziel, der Bundesrepublik zu schaden. Im Gegenteil: Bei weitem nicht alles, was gut für den BND ist, ist auch gut für Deutschland. Mit unserer Arbeit möchten wir dazu beitragen, dass statt Symbolpolitik und demokratiegefährdenden Blankoschecks für Geheimdienste wirklich etwas getan wird, um die IT-Sicherheit zu verbessern. Dadurch stärken wir zugleich unsere Demokratie, weil wir einen gesellschaftlichen Diskurs über die Prioritäten der Bundesregierung und ihre Krypto-Strategie ermöglichen.

Wir sind schon einmal wegen der Veröffentlichung von geheimen Haushaltsplänen in unserer Arbeit bedroht worden. Wir lassen uns davon nicht einschüchtern und werden weiter daran arbeiten, journalistisch Licht ins Dunkel zu bringen und zu dokumentieren, wie der Ausbau der Massenüberwachung die Grundfesten unserer Demokratie beschädigt und aushöhlt. Unsere Motivation ist, die Öffentlichkeit zu zu informieren und eine gesellschaftliche Debatte auszulösen. Das können wir auch nur Dank Eurer finanziellen Unterstützung durch Spenden und Daueraufträge.

Unterstütze unsere Recherchen und Berichterstattung für Grundrechte und ein freies Internet durch eine Spende.

Am 1. November schrieb Reiner Heyse vom www.seniorenaufstand.de einen offenen Brief an seinen IG-Metall Vorsitzenden Jörg Hofmann. Dieser sollte zu den „irritierenden“ Plänen seiner Gewerkschaft zur Stärkung der betrieblichen Altersvorsorge Stellung beziehen. Die NDS berichteten. Bis heute – nahezu drei Wochen später – ist keinerlei Reaktion erfolgt. Anlass für Heyse, an die Beantwortung zu erinnern: Albrecht Müller

Dieser Beitrag ist auch als Audio-Podcast verfügbar.

„Du, oder ihr, schweigt. Man muss das schon als dröhnendes Schweigen wahrnehmen. Dieses Schweigen ist ja nicht neu. Seit zwei Jahren wurden im Sozialministerium Verhandlungen hinter verschlossenen Türen durchgeführt. Von gewerkschaftlicher Seite, die beteiligt war, ist nicht ein Sterbenswörtchen durchgesickert. Ich habe Dir, Jörg, vorgehalten die Positionen des Gesamtverbandes der deutschen Versicherungswirtschaft zu großen Teilen kopiert zu haben. Deine Position hast Du gegenüber dem Handelsblatt erklärt. Gegenüber den Mitgliedern nicht. Bis heute nicht.“

Und weiter:

„Auf dem Sozialstaatskongress 4.0 hatte ein Wissenschaftler vorsichtig kritisiert, dass die Zielrichtung der IG Metall zu stark auf die engen Interessen der IG Metall-Klientel ausgerichtet sei. Dass erst einmal die Wiederherstellung des Sozialstaats 1.0 entscheidend sei.“

Mit dieser Aussage wird vielleicht auch das Dilemma deutlich, unter welchem die DGB-Kampagne zur Stärkung der gesetzlichen Rentenversicherung leidet: die Einzelgewerkschaften unter dem Dach des DGB haben durchaus unterschiedliche Interessen, weil sie eine unterschiedliche Klientel „bedienen“. Mitglieder der Industriegewerkschaften wie IG Metall und IGBCE sind mit ihren Löhnen durchaus in der Lage und vermutlich auch willens, monatlich einen Betrag für eine zusätzliche betriebliche Altersversorgung abzuzwacken. Bei dem weit überwiegenden Teil der ver.di-Mitglieder aber dürfte das ungleich schwieriger sein. Man wundert sich, dass es überhaupt gelungen ist, die Rentenkampagne gemeinsam zu verabschieden.

Auf der Kampagnenseite der IG Metall sucht man Aussagen zur betrieblichen Altersvorsorge übrigens noch vergebens, und auch beim DGB ist eine Aussage zur Betriebsrente nicht zu finden: www.rente-muss-reichen.de.

Das DGB-Vorstandsmitglied Annelie Buntenbach hat dem Deutschlandfunk zum gestrigen Rentengipfel ein Interview gegeben. Darin erwähnt sie quasi in einem Nebensatz die Stärkung der Betriebsrenten:

„(…), weil es nötig ist, dass die Rente auf dem heutigen Niveau auch wirklich stabilisiert wird und nicht noch weiter in den Keller geht. Aber es gibt ja auch weitere Baustellen in der Rentenpolitik, die die Koalition anpacken muss. Und da gehört die Verbesserung der Erwerbsminderungsrenten ganz oben auf die Tagesordnung. Und der zweite Punkt ist die weitere Verbreiterung und Förderung der Betriebsrenten. Es wird auch um die Frage der Unterstützung von Geringverdienerinnen und Geringverdienern gehen und die Frage der Ost-West-Angleichung. Alles das sind Baustellen, wo ich erwarte, dass die Koalition hier praktikable Antworten auf den Tisch legt. Aber für uns ganz oben an steht die Stabilisierung des Rentenniveaus, weil das die Grundlage ist, auf der die Rente in der Zukunft dann beruhen soll.“

Hier finden Sie die Eckpunkte des Entwurfs.

Über den gestrigen Rentengipfel weiß die Rheinische Post unter anderem Folgendes zu berichten:

Private Vorsorge Union und SPD haben sich bereits auf ein neues steuerlich gefördertes Betriebsrentenmodell für Einkommen bis 2000 Euro brutto und auf eine Erhöhung der Riester-Förderung geeinigt. Das Gesetz soll Anfang 2018 in Kraft treten.

Rentenniveau Nahles, die bereits am Freitag das Gesamtkonzept vorstellt, will verhindern, dass das Rentenniveau, der Anteil der Rente am Durchschnittslohn, von 48 auf bis zu 41,6 Prozent im Jahr 2045 absinkt. Sie fordert eine neue „Haltelinie“ für die Zeit ab 2030. Dies kann jedoch deutlich höhere Rentenbeiträge, einen erheblich höheren Rentenzuschuss des Bundes oder den weiteren Anstieg des Rentenalters bedeuten – oder eine Mischung aus allem. Die Union verlangt eine neue Rentenkommission, die für eine solche große Reform erst in der nächsten Leigslaturperiode Vorentscheidungen treffen soll.

Reiner Heyse muss die Antwort seines Vorsitzenden eigentlich nicht mehr abwarten, denn Jörg Hofmann könnte vermutlich nur dieses berichten:

  • Die Erhöhung der Riesterförderung ist von den Koalitionspartnern eingetütet.
  • Das steuerlich geförderte Betriebsrentenmodell ist von den Koalitionspartnern eingetütet.
  • Dass die von Nahles verkündete „Haltelinie“ für das Rentenniveau bereits mit weiteren „Grausamkeiten“ für die Beitragszahler angekündigt wird, überrascht nicht wirklich. Wütend macht es trotzdem.
  • Warten wir ab, wie uns diese Ergebnisse heute und in den nächsten Tagen als politische Meisterleistungen verkauft werden. Und entlarven wir diese Mogelpackung.

    Flattr this!