Digital influence: unleash the power of influencer marketing to accelerate your global business / Joel Backaler ; foreword by Peter Shankman
[ASAP] A Nanostructured Gold/Graphene Microfluidic Device for Direct and Plasmonic-Assisted Impedimetric Detection of Bacteria
[ASAP] Genetic Engineering-Facilitated Coassembly of Synthetic Bacterial Cells and Magnetic Nanoparticles for Efficient Heavy Metal Removal
[ASAP] Aggregation-Dependent Photoreactive Hemicyanine Assembly as a Photobactericide
Lost in the mountains? Here’s how to find your way back
In the mountains, losing yourself and losing your way are two different things. A seasoned biker and explorer tells you how to find your way
[ASAP] Asymmetric Synthesis of a Bacteriochlorophyll Model Compound Containing <italic toggle="yes">trans</italic>-Dialkyl Substituents in Ring D
A signal cascade amplification strategy based on RT-PCR triggering of G-quadruplex DNAzyme for a novel electrochemical detection of viable Cronobacter sakazakii
DOI: 10.1039/D0AN00270D, Paper
Cronobacter sakazakii is an important opportunistic food-borne pathogen, and it can cause severe diseases with main symptoms including neonatal meningitis, necrotizing enterocolitis, and sepsis. For the achievement of practical and...
The content of this RSS Feed (c) The Royal Society of Chemistry
Rapid detection of 21 β-lactams using an immunochromatographic assay based on the mutant BlaR-CTD protein from Bacillus Licheniformis
DOI: 10.1039/D0AN00421A, Paper
In this study, a gold immunochromatographic assay (GICA) based on a penicillin receptor protein (PBP) is proposed to simultaneously detect penicillin, cephalosporin, and carbapenem antibiotics in milk and chicken.
The content of this RSS Feed (c) The Royal Society of Chemistry
An electrochemical biosensor based on methylene blue-loaded nanocomposites as signal-amplifying tags to detect pathogenic bacteria
DOI: 10.1039/D0AN00470G, Paper
Synthesis of new methylene blue–magainin I organic–inorganic nanocomposites as electrochemical signal labels for the detection of bacteria.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry
[ASAP] Efficient and Reproducible Multigene Expression after Single-Step Transfection Using Improved BAC Transgenesis and Engineering Toolkit
[ASAP] Blue-Light-Switchable Bacterial Cell–Cell Adhesions Enable the Control of Multicellular Bacterial Communities
[ASAP] Introduction of the Menaquinone Biosynthetic Pathway into <italic toggle="yes">Rhodobacter sphaeroides</italic> and <italic toggle="yes">de Novo</italic> Synthesis of Menaquinone for Incorporation into He
[ASAP] A Synthetic Genetic Circuit Enables Precise Quantification of Direct Repeat Deletion in Bacteria
[ASAP] Facilitating Protein Expression with Portable 5'-UTR Secondary Structures in <italic toggle="yes">Bacillus licheniformis</italic>
[ASAP] Bacteriophage Inspired Growth-Decoupled Recombinant Protein Production in <italic toggle="yes">Escherichia coli</italic>
[ASAP] Multicomponent Microscale Biosynthesis of Unnatural Cyanobacterial Indole Alkaloids
[ASAP] MymA Bioactivated Thioalkylbenzoxazole Prodrug Family Active against <italic toggle="yes">Mycobacterium tuberculosis</italic>
[ASAP] Molecule Property Analyses of Active Compounds for <italic toggle="yes">Mycobacterium tuberculosis</italic>
[ASAP] Exploration of the Structural Space in 4(3<italic toggle="yes">H</italic>)-Quinazolinone Antibacterials
[ASAP] Discovery of a Cyclic Choline Analog That Inhibits Anaerobic Choline Metabolism by Human Gut Bacteria
Back to the :roots
The cascade in CSS is a curse and blessing at the same time. It usually works quite well, but there are issues that let people get all worked up and ask the question Do We Even Need CSS Anymore. I can somewhat relate to that - but I also think it’s not the cascade alone and also about fighting specificity. Not running into issues with specificity is hard. Almost as hard as pronouncing that word.
In this post I’ll try to show a few ways how you can make the cascade be your friend and maybe reduce the need of overriding and thus encounter less fighting with specificity.
Tip 1:
For every CSS property that you write, try to move it up the tree as far as possible. In other words: Back to the :root.
For example, our site has a side bar and we want to add a short bio to it. The markup might look something like this:
<body>
<main class=“Posts”>
<aside class=“SideBar”>
<nav class=“Nav”>
<p class=“Bio”>
And the CSS:
.Bio {
font-size: .8em;
line-height: 1.5;
color: #888;
}
That would work. But if we look at the Nav that is already in the SideBar, chances are good that some of the styles are the same. In our case it’s font-size
and color
. So let’s remove those properties from Nav and Bio and add it to the shared parent element, the SideBar.
.SideBar {
font-size: .8em;
color: #888;
}
And as it turns out, that line-height: 1.5;
is already defined for our Posts. So since it seems that the whole page uses the same line-height, let’s remove it from the Bio and Post elements and move it all up to the root node.
:root {
line-height: 1.5;
}
This probably sounds like common sense, but often it’s tempting to just style your new thing without even looking if some of the sibling elements define the same thing. This also happens when you copy&paste styles from another section or when pasting some snippets you found online. It might take a bit more time to refactor and seems scary, but it should keep our CSS in a healthier state.
Style the branches, not each leaf
Tip 2:
Style certain properties always as a combo.
A good example is the color
and background-color
combo. Unless you make only small tweaks, it’s probably a good idea to always change them together. When adding a background color to an element, it might not contain any text, but probably some child will. Therefore if we set foreground and background color together, we can always be sure we won’t run into any legibility and contrast issues. Also, next time we change a background color, we don’t have to hunt for all the text colors that need to be changed too, it’s right there in the same place.
Screenshot from Colorable
Tip 3:
Use “dynamic” values, such as
currentColor
andem
s.
Sometimes it might make sense to use the text color
for other properties. Like for border
, box-shadow
or for the fill
of SVG icons. Instead of defining them directly you can use currentColor
and it will be the same the color
property. And since color
inherits by default, you might can change it in only one place.
Similarly em
s are mapped to font-size
allowing you to scale everything by just changing the :root font size.
Here a few more details on currentColor and EMs.
Tip 4:
Override UA Styles to
inherit
from its parents.
Form controls like buttons, inputs get styled by the browser in a certain way. Overriding them with inherit
makes them adapt to your own styles.
button,
input,
select,
textarea {
color: inherit;
font-family: inherit;
font-style: inherit;
font-weight: inherit;
}
The example above is taken from sanitize.css. normalize.css does the same, so if you use them, you’re already covered.
You can also try to restyle other inputs like a range slider, radio, checkbox etc. And as seen above, by using currentColor
, make them automatically match the color property. And maybe move them from a light into a dark theme without changing anything.
Conclusion
That’s all nice stuff, but who is it for? Well, of course it can’t be forced upon every situation. I would say small and simple web sites benefit the most. But even when using a preprocessor, it might not hurt if it reduces the amount of CSS that gets output or when a few variables aren’t even needed.
Also it seems suited for the “single purpose class” approach like Tachyons. It might reduce complexity and the amount of classes that are needed.
Another interesting thing could be the upcoming custom properties a.k.a. CSS variables. Unlike variables in preprocessors, when overriding a custom property, it will only affect the current selector scope. So in a sense they will be “cascading variables”. But I still have to try that out and see how it works in practice.
ps. It is possible that this post is inspired by this tweet.
Modernists & mavericks: Bacon, Freud, Hockney & the London painters / Martin Gayford
From the Backstage of Publishing: Memories of Milton Murayama
Originally this post was a way to mark this month’s Asian/Pacific American Heritage Month by sharing personal memories from an editorial perspective of a pioneering Asian American literary icon, Milton Murayama. It has grown to include other remembrances from a marketing perspective. We are all proud to be the publisher of his bestselling novels. Masako […]
Then come back: the lost Neruda poems / Pablo Neruda ; translated by Forrest Gander
Oratorio para observador hombre exhausto y coro de astronautas: Oratorium für Beobachter erschöpften Menschen und Astronautenchor / Andrés Recasens Salvo ; Harald Wentzlaff-Eggebert (Hg.) ; übersetzt von Wera Zeller
The Palgrave handbook of indicators in global governance / Debora Valentina Malito, Gaby Umbach, Nehal Bhuta, editors
Female authorship and the documentary image: theory, practice and aesthetics / edited by Boel Ulfsdotter and Anna Backman Rogers
Female agency and documentary strategies: subjectivities, identity and activism / edited by Boel Ulfsdotter and Anna Backman Rogers
William Shakespeare's Get thee back to the future! / Ian Doescher
REL Webinar: Using Teacher Feedback in School Leader Evaluations
The goal of the webinar is to expand local and state leaders’ knowledge of teacher survey instruments to enhance the evaluation of school leaders.
Live cell fluorescent stain of bacterial curli and biofilm through supramolecular recognition between bromophenol blue and CsgA
DOI: 10.1039/D0CC01643H, Communication
A curli fluorescent light-up probe called bromophenol blue, which binds to curli via recognizing CsgA.
The content of this RSS Feed (c) The Royal Society of Chemistry
From bacteria to Bach and back : the evolution of minds / Daniel C. Dennett
Pushing back: women of color-led grassroots activism in New York City / Ariella Rotramel
Taking back the boulevard: art, activism and gentrification in Los Angeles / Jan Lin
After the rise and stall of American feminism: taking back a revolution / Lynn S. Chancer
Kant's revolutionary theory of modality / Uygar Abaci
The mark of theory: inscriptive figures, poststructuralist prehistories / Andrea Bachner
Atomistic intuitions: an essay on classification / by Gaston Bachelard ; translated by Roch C. Smith ; preface by Daniel Parrochia
Bio-fabricated ZnO nanoparticles: direct sunlight-driven selective photodegradation, antibacterial activity, and thermoluminescence-emission characteristics
DOI: 10.1039/D0NJ01611J, Paper
Zinc oxide (ZnO) nanoparticles were prepared via a Gliricidia sepium leaf extract-assisted green synthetic route. Near-spherical and elongated nanoparticles were obtained according to morphology analysis.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry
Electrospun poly (3-hydroxybutyrate-co-3-hydroxyvalerate) / Polyethylene oxide (PEO) microfibers reinforced with ZnO nanoparticles for antibacterial and antibiofilm wound dressing applications
DOI: 10.1039/D0NJ01384F, Paper
Biocompatible and biodegradable polymers are extensively used in designing wound dressing materials. The present investigation deals with the preparation of a unique blend of zinc oxide (ZnO) nanoparticles incorporated in...
The content of this RSS Feed (c) The Royal Society of Chemistry