it

China’s New Large Solar-Powered Drone Reaches 20,000 Meters in Altitude

China’s first domestically designed large solar-powered unmanned plane reached above 20,000 meters in altitude on its test flight in the country’s northwest regions recently. The drone was developed by the China Academy of Aerospace Aerodynamics (CAAA), it’s developers kept the exact size of the drone as a secret, but it is believed to be about 14 …

The post China’s New Large Solar-Powered Drone Reaches 20,000 Meters in Altitude appeared first on LatestSolarNews.




it

4 Benefits Of Solar LED Lights For Parking Lots

The future is solar LED lights. You will see them in the parking lots and other large areas around a city. They are cheap and save a good deal of money on electricity bills. Nowadays, the majority of parking lots feature the conventional lights that get their power from the grid. These products are not …

The post 4 Benefits Of Solar LED Lights For Parking Lots appeared first on LatestSolarNews.




it

A BEM syntax with UX in mind

At some point, while working on the MontageJS framework, the question came up what CSS naming convention we should start using. After a long discussion we settled on using the BEM methodology, but changed the syntax a bit. To keep this post short, I won’t go into detail why using BEM is a good idea, but rather explain why we chose a different syntax. Here some examples:

.digit-Progress          /* org-Component */
.digit-Progress-bar      /* org-Component-childElement */
.digit-Progress--small   /* org-Component--variation */

Note: The org- (digit-) prefix is used as a name-space so it wouldn’t conflict with other packages/libraries/frameworks.

Now let’s take a look at the reasons for choosing such a syntax.

Hyphens (-)

The main reason why we’re using a hyphen (-) instead of underscores (_), has to do with the fact that their behavior is different when double-clicking to select text. Try for yourself:

component__element /* underscores */
component-element  /* hyphen */

See how when you’re using underscores it selects the part before and after, in this case the whole component__element. But with hyphens it let’s you select only the part you double-clicked. component OR element. This let’s you quickly edit only the parts you want:

camelCase

Now, what if the component or child element consists of multiple words? We could use underscores like component_name-element_name. It would still be double-clickable, but readability suffers since it’s harder to see what belongs together. Better to use camelCase which groups each part visually: componentName-elementName.

MainComponent

OK, I think we’re getting closer. As a last rule, for the “main” component we use PascalCase. The reason for it is to add emphasis and make it easier to distinguish the main component from a child element. Also when using a namespace, the component moves to the second position, which makes it even more important to have it stick out: org-Component-childElement

–variation

We kept the more commonly used double hyphens (–) for variations. digit-Progress--small. It makes sense, because it pulls the variation (–small) visually more apart and makes it look like it’s something “different” than the default component.


So that’s about it. For more details about this naming convention, take a look at the SUIT framework, which also started to use the same syntax and documented it really well.

In the end, whatever Shade of BEM you choose to cook with probably depends on your personal taste, but thinking about a great UX by improving usability and readability won’t hurt either.




it

Styling with STRINGS

At this year’s CSSConf in Melbourne (AU) I gave a talk called “Styling with STRINGS”. The talk is about how we can use Flexbox, currentColor and __EM__s inside components to quickly style entire Web Apps straight in the browser.

In case of tl:dw here some of the main points:

Layout

When creating mobile “App” layouts, where not the whole page is scrollable, but instead only certain parts. And you have anchored areas like header/footer and a main area that should fill out the available space, then the easiest way is to use Flexbox.

This lets you easily drag around components that are set as flex items and they always position nicely. Using flex: 1; on components makes them stretch out and fill the available space. A good use case is a search input or a title.

Color

If you don’t specify the border-color (initial value) it will be the same value as color.

Furthermore there is a color value called currentColor. As the name indicates, it’s also mapped to the current color value. We can use it as background-color for example. Not that useful when the text should be readable, since now text and background are the same color, but for some components without text it can be quite useful. Like in the example below with the slider thumb.

If a component set should look similar to the “iOS 7” style then currentColor works great. Below all components have no color values at all and only use currentColor. This let’s us change everything by only changing the color value in the root html element.

Size

In a similar way, EMs are mapped to font-size. So if we use EMs to define only the proportions of a component, we can use font-size to scale it up/down. And if we inherit the font-size we could also control everything at once with just a single property in the root or in groups if we go deeper down the DOM tree.

REMs work the same except that they are tied to the root html element only. We could use it to control the spacing of the components by using REMs for margin/padding.

I wrote about this in more detail in the Sizing (Web) Components post.

All together

Now if we combine this all and test it in an example application, we can easily design many variations right from the DevTools/inspector in a quick and easy way.

Feel free to play around with the CSSConf App yourself or check out the source on GitHub.

How to save?

You might wonder how you can save the changes made in the DevTools/inspector without having to manually copy them over into your CSS file. In Chrome there is a feature called Workspaces. It let’s you map a URL to a local folder. Once that is setup, all CSS changes will automatically be saved to your local disc. Here a post that explains how to setup Workspaces. It’s advised to use version control like Git, so that you can always discard all changes if you went too far and wanna start over.

Conclusion

Admittedly it is somewhat in between of being useful for production and just a “hack”. Especially the currentColor. But the main point of the talk is best told by this quote:

“Creators need an immediate connection” — Bret Victor

The examples I used are just the closest I could get using CSS alone and still keep code clean. I hope we keep that principle alive and improve on it.


ps. Artist of the puppet master illustration: Unknown.

pss. Here all the other videos from CSSConf.




it

Contextual styling with custom properties

Something I’ve been wanting for a long time, define different regions like a footer section, or side bar and not have to deal with all the contextual styling hassle. A.k.a. “Now that this button is used on a dark background, the button needs to change its colors too. Where should the styles live?”. Here an old post about struggling with contextual styling.

So then the other day I was doing some experiments with using custom properties for Atom’s UI. Turns out, using custom properties might make contextual styling a bit easier. For the rest of the post, let’s switch to a more simple example. A page where the main area is light, but then has a dark hero and footer section. Like this:

In the past, I probably would’ve created variations like Button--dark or overwrote it with header .Button {…}. Depends a bit on the project. Here another approach: Create themes with a set of variables, then apply the theme to the different areas.

1. Default theme

First let’s define our default theme with a bunch of variables.

[data-theme="default"] {
  --fg:         hsl(0,0%,25%);
  --border:     hsl(0,0%,75%);
  
  --bg:         hsl(0,0%,95%);
  --button-bg:  hsl(0,0%,99%);
  --input-bg:   hsl(0,0%,90%);
}

Then we create some components where we use the variables defined above.

[data-theme] {
  color: var(--fg);
  background-color: var(--bg);
}

.Button {
  color: var(--fg);
  border: 1px solid var(--border);
  background-color: var(--button-bg);
}

.Input {
  color: var(--fg);
  border: 1px solid var(--border);
  background-color: var(--input-bg);
}

And lastly we add the [data-theme="default"] attribute on the body so that our components will pick up the variables.

<body data-theme="default">

If you wonder why use data-theme attributes over classes? Well, no specific reason. Maybe with attributes, it’s a hint that only one theme should be used per element and is more separated from your other classes.

At this point we get this:

See the Pen Contextual styling with custom properties (1/3) by simurai (@simurai) on CodePen.

2. Dark theme

But our designer wants the hero and footer to be dark. Alright, let’s define another theme region.

[data-theme="dark"] {
  --fg:         hsl(0,10%,70%);
  --border:     hsl(0,10%,10%);
  
  --bg:         hsl(0,0%,20%);
  --button-bg:  hsl(0,0%,25%);
  --input-bg:   hsl(0,0%,15%);
}

And add the theme attribute to the header and footer.

<header data-theme="dark">
<footer data-theme="dark">

Which gives us this:

See the Pen Contextual styling with custom properties (2/3) by simurai (@simurai) on CodePen.

The reason why this works is that custom properties cascade and can be overridden on nested elements, just like normal properties.

3. Hero theme

A few months pass and our designer comes back with a redesigned hero section. “To make it look fresh” with a splash of color.

No problem! Just like with the dark theme, we define a new “hero” theme.

[data-theme="hero"] {
  --fg:         hsl(240,50%,90%);
  --border:     hsl(240,50%,10%);
  
  --bg:         hsl(240,33%,30%);
  --button-bg:  hsl(240,33%,40%);
  --input-bg:   hsl(240,33%,20%);
}
<header data-theme="hero">

And here is that fresh hero:

See the Pen Contextual styling with custom properties (3/3) by simurai (@simurai) on CodePen.

It’s also not limited to colors only, could be used for sizes, fonts or anything that makes sense to define as variables.

Benefits

Using these theme “regions” lets your components stay context un-aware and you can use them in multiple themes. Even on the same page.

  • Developers can add components, move components around, without having to know about in what context (theme) they live. The markup for the components stays the same.
  • Design systems authors can create new components without worrying about where they get used, the variables used in components stay the same.
  • Designers can define new theme regions, or change existing ones, without having to make changes to a component’s HTML or CSS, it stays the same.

Less time to talk about who, how and where, more time to talk about the weather. ☔️????

Concerns

Yeah, right. The big question: But does it scale? Can this be used for all use cases.

Ok, I’m pretty sure it doesn’t fit all situations. There are just too many to find a single solution for them all. And I’m actually not sure how well it scales. I guess it works great in these simple demos, but I have yet to find a larger project to test it on. So if you have used (or plan to use) this approach, I’m curious to know how it went.

A concern I can imagine is that the list of variables might grow quickly if themes have totally different characteristics. Like not just a bit darker or lighter backgrounds. Then you might need to have foreground and border colors for each component (or group of components) and can’t just use the general --fg and --border variables. Naming these variables is probably the hardest part.

Update I

@giuseppegurgone made an interesting comment:

in suitcss projects I used to define component level custom props, theme variables and then create themes by mapping the former to the latter suitcss-toolkit

So if I understood it correctly, by mapping theme variables to component variables, you could avoid your theme variables from growing too much and you can decide for each component how to use these theme variables.

Update II

If it’s too early to use custom properties in your project, @szalonna posted an example how to do something similar in SCSS.




it

Unlock Your Team’s Potential With Teamstack

Teamstack is a password manager for your whole team. Running in the cloud it allows you to manage your tools and resources, and seamlessly scale your teams’ access, from a single, easy-to-use control panel. Teamstack is powerful, and secure with multi-factor authentication, single sign-in, SAML and form-based authentication. It works with desktop and mobile apps, […]




it

Thanks to Covid-19, Website Accessibility Has Never Been More Important

The first global pandemic of the digital era is upon us. We’re living in unprecedented and uncomfortable times. For our senior citizens, these past several weeks have been particularly discomforting. According to the CDC, men and women over the age of 65 are significantly more likely to develop complications from COVID-19. As we seek to […]




it

The matter of photography in the Americas / Natalia Brizuela and Jodi Roberts ; with contributions by Lisa Blackmore, Amy Sara Carroll, Marianela D'Aprile, María Fernanda Domínguez, Heloisa Espada, Rachel Price, Diana Ruiz, Tatiane Santa Ro

Rotch Library - TR184.B75 2018




it

Library of light: encounters with artists and designers / Jo Joelson

Rotch Library - N8219.L5 J64 2019




it

Huguette Caland / edited by Anne Barlow, Sara Matson and Giles Jackson ; texts by Anne Barlow, Brigitte Caland and Negar Azimi

Rotch Library - N6537.C329 A4 2019




it

Mathias Goeritz: modernist art and architecture in Cold War Mexico / Jennifer Josten

Rotch Library - N6559.G64 J67 2018




it

Legacy of the masters: painting and calligraphy of the Islamic world from the Shavleyan family collection / Will Kwiatkowski ; with contributions by John Seyller

Rotch Library - N6260.K87 2019




it

For your pleasure: Johannes Brus, photoworks and sculptures / with an essay by Clément Chéroux

Rotch Library - N6888.B745 A4 2018




it

Bauhaus imaginista: a school in the world / edited by Marion von Osten and Grant Watson

Rotch Library - N332.G33 B42724 2019




it

Leonardo da Vinci: nature and architecture / edited by Constance Moffatt, Sara Taglialagamba

Rotch Library - N6923.L33 M64 2019




it

The Pre-Raphaelites and science / John Holmes

Hayden Library - NX454.5.P7 H65 2018




it

Djordje Ozbolt: regaining memory loss / exhibition curator, Nicoletta Lambertucci

Rotch Library - N6488.I8 V433 2019 Y8




it

El nombre de un país / Mariana Telleria ; curadora, Florencia Battiti

Rotch Library - N6488.I8 V433 2019 A7




it

Gordon Parks: the new tide, early work, 1940-1950 / Philip Brookman ; with essays by Maurice Berger, Sarah Lewis, Richard J. Powell, Deborah Willis ; series editor, Peter W. Kunhardt, Jr

Rotch Library - TR647.P37 2018




it

Art for people's sake: artists and community in Black Chicago, 1965-1975 / Rebecca Zorach

Rotch Library - NX512.3.A35 Z67 2019




it

It's about time: Pavilion of Applied Arts / curator, Ralph Rugoff ; artist, Marysia Lewandowska

Rotch Library - N6488.I8 V433 2019 A67




it

Failed images: photography and its counter-practices / Ernst van Alphen

Rotch Library - TR183.A47 2018




it

Fields of fungus and sunflowers / [edited and designed by Tammy Nguyen ; contributions by Lovely Umayam and Adriel Luis]

Rotch Library - N7433.35.U6 M37 no.6




it

Altered states: Substanzen in der zeitgenössischen Kunst = substances in contemporary art / herausgegeben von = edited by Milena Mercer ; Texte = texts, Max Daly ... [and thirteen others]

Rotch Library - N8251.S555 A48 2018




it

Beatriz Milhazes: rio azul / White Cube

Rotch Library - N6659.M55 A4 2018




it

Fogo Island arts: what do we know? What do we have? What do we miss? What do we love? / Brigitte Oetker, Nicolaus Schafhausen (eds.)

Rotch Library - N6546.N6 F64 2019




it

Le modèle noir: de Géricault à Matisse: Musée d'Orsay / [éditeur, Claude Pommereau]

Rotch Library - N8232.M6325 2019




it

Raoul de Keyser: oeuvre / editors, Martin Germann and Bernhart Schwenk

Rotch Library - ND673.K396 A4 2019




it

Dorothy Iannone: a cookbook / Dorothy Iannone ; [edited by Clément Dirié]

Rotch Library - N6537.I26 A4 2018




it

April in Paris: theatricality, modernism, and politics at the 1925 Art Deco Expo / Irena R. Makaryk

Hayden Library - N6493 1925.M35 2018




it

Exercises in freedom: polnische Konzeptkunst, 1968-1981 = Polish conceptualism, 1968-1981 / Herausgeber = editor, Staatliche Kunstsammlungen Dresden, Kupferstich-Kabinett, Björn Egging

Rotch Library - N7255.P6 E88 2018




it

Animal: exploring the zoological world / project editor, Lucy Kingett

Hayden Library - N7660.A653 2018




it

The M.V.M. Cappellin glassworks and the young Carlo Scarpa: 1925-1931 / edited by Marino Barovier and Carla Sonego

Rotch Library - NK5205.S28 A4 2018




it

My dearest Aiyana / [contributors, Daniil Davydoff, Naima Green, and Tuan Andrew Nguyen ; edited by Tammy Nguen]

Rotch Library - N7433.35.U6 M37 no.7




it

Sunniness in painting: from Edward Hopper to David Hockney / Nicola Vitale

Rotch Library - ND1140.V58 2019




it

T.C. Cannon: at the edge of America / edited by Karen Kramer ; with contributions by heather ahtone, Sherwin Bitsui, Caitlin Cooper, Frank Buffalo Hyde, Trevor Fairbrother, Santee Frazier, Joy Harjo, Joan Naviyuk Kane, Karen Kramer, Deana McCloud, America

Rotch Library - NX512.C36 A4 2018




it

Socially engaged art and the neoliberal city / Cecilie Sachs Olsen

Rotch Library - N72.A76 O47 2019




it

Sergei Romanov / edited by Oksana Salamatina ; essay by Lyle Rexer

Rotch Library - TR655.R66 2018




it

Ghana freedom: Ghana pavilion at the 58th International Art Exhibition La Biennale di Venezia

Rotch Library - N6488.I8 V433 2019 G4




it

Photography reframed: new visions in contemporary photographic culture / edited by Ben Burbridge and Annebella Pollen

Rotch Library - TR185.P52 2018




it

Julian Charrière: second suns / edited by Nadim Samman

Rotch Library - N7153.C465 A4 2018




it

Khnum, across times witness: Egyptian pavilion

Rotch Library - N6488.I8 V433 2019 E3




it

The moon: from inner worlds to outer space / edited by Lærke Rydal Jørgensen and Marie Laurberg ; translations, Glen Garner, James Manley, Jane Rowley

Barker Library - NX650.M6 M663 2018




it

Harry Clarke and artistic visions of the new Irish state / edited by Angela Griffin, Marguerite Helmers & Róisín Kennedy

Rotch Library - NK5398.C64 H37 2019




it

Dialogues with solitudes / Dave Heath ; [editors: Diane Dufour, Pierre Hourquet, with Julie Héraut]

Rotch Library - TR647.H42 2018




it

White privilege likes / Lyall Harris

Rotch Library - N7433.4.H37 W45 2018




it

Discordo ergo sum: Renate Bertlmann / curator, Felicitas Thun-Hohenstein

Rotch Library - N6488.I8 V433 2019 A9




it

Model as painting / Pieter Schoolwerth ; contributors, Pieter Schoolwerth, David Geers, Molly Warnock ; editor: Katherine Pickard

Rotch Library - N6537.S3589 A4 2019




it

Under the palm trees: modern Iraqi art with Mohamed Makiya and Jewad Selim / Ahmed Naji

Rotch Library - N7267.N45 2019




it

Mary Corse: a survey in light / Kim Conaty ; with contributions from Robin Clark, Michael Govan, Alexis Lowry, and David Reed

Rotch Library - N6537.C663 A4 2018