Existe una propiedad CSS que remueve toda propiedad CSS aplicada por el browser a un selector y la deja sin nada, desnuda y cruda. No me refiero a un reseter, menos a un normalizer. La propiedad all: unset;
aplicada a un selector, por ejemplo, un <input />, <button>, <select> y muchos otros que tienen diferencias de render entre browsers, puedes remover todo estilo aplicado por defecto y crear los tuyos de cero sin tener que sobre-escribirlos.
Un ejemplo a continuación con los siguientes elementos HTML:
<button>button</button>
<input type="text" value="input">
<select>
<option>select</option>
</select>
<a href="#">link</a>
See the Pen Example 1: CSS `all: unset` property / value by Jorge Epuñan (@juanbrujo) on CodePen.
Crearemos una clase CSS para aplicar el estilo a las etiquetas y ver el resultado esperado:
.unstyle {
all: unset;
}
See the Pen Example 2: CSS `all: unset` property / value by Jorge Epuñan (@juanbrujo) on CodePen.
Al aplicar all: unset;
todo parece similar, solo texto los cuales puedes aún interactuar (button, input, select y link (si tuvieran algo). Ahora podemos crear estilos base para, por ejemplo, .button
donde el mismo estilo se aplique a todas las etiquetas que tengan esta clase:
See the Pen Example 3: CSS `all: unset` property / value by Jorge Epuñan (@juanbrujo) on CodePen.
Como observan, no necesitamos quitar el text-decoration: underline;
del <a>o el border: 0;
del <button>, simplemente escribimos el CSS que queremos para cualquier etiqueta que necesitamos se comporte como un botón.
Últimas observaciones
Como consejo, no se les ocurra utilizar esta propiedad como su nuevo reseter / normalizar o algo por el estilo:
body {
all: unset;
...
}
Esta propiedad es para situaciones puntuales, como las que acabo de mostrar. Quizás para listas (ordenadas, desordenadas o de definición) y algunos otros elementos puntuales. Quizás sea útil para crear componentes de vista (UI components) en sus propias guías de estilos.
Soporte:
A la fecha de publicado este artículo no se ve mal:
Comentarios
Greate article. Keep posting such kind of info on your page. Im really impressed by your blog. Renata Micheil Elwina
Way cool! Some extremely valid points! I appreciate you writing this article and also the rest of the site is really good.| Adda Arlan Ful
This can be a set of words, not an essay. that you are incompetent Lydie Randal Corene
Having read this I thought it was extremely enlightening. I appreciate you taking the time and energy to put this informative article together. I once again find myself spending a significant amount of time both reading and commenting. But so what, it was still worth it! June Rowan Monto
Today, there are actually many nationwide relocating providers and far away moving companies around the United States involving various sizes and shapes. In small towns and areas, family-operated relocating firms are rather prominent. This is actually mostly since they individually recognize the owners and understand that they can place leave on their relocation companies. Having said that, a lot of our company must take care of finding good quality best-rated nationally moving companies to hire from square one. Mirabelle Che Naples
Buna ziua, puteti repeta procedura, insa trebuie sa aveti in vedere ca acest lucru s-a intamplat pentru ca, clatirea nu a fost facuta conform cu recomandarile din instructiuni. Va rugam sa treceti prin fiecare pas cu timpii indicati. O zi frumoasa. Martha Arney Utter
Oh wow! Can you imagine that being your School! Amazing building. Thanks forsharing Gloriana Arvy Lundeen
Please keep throwing these posts up they help tons. Lacee Ritchie Christoffer
I think this is a real great post. Thanks Again. Cool. Laura Jeffy Haimes
Hiya, I am really glad I have found this info. Today bloggers publish only about gossip and web stuff and this is really frustrating. A good website with interesting content, this is what I need. Thank you for making this web site, and I will be visiting again. Do you do newsletters by email? Tarra Joe Chapnick
I would like to save all my blog posts on wordpress ? Nadiya Warden Aggi
Dank Dies ist ein sehr guter Artikel!. Ich mag Deine Webseite! Kipp Sauncho Vena
But wanna tell that this is invaluable , Thanks for taking your time to write this. Saba Benjie Verile
Excellent article! We are linking to this great post on our website. Keep up the great writing. Debor Johannes Vallie
My brother recommended I would possibly like this blog. Angy Dudley Kiehl
Sonus Complete is a supplement that aims to simply help people eliminate tinnitus by strengthening the mind network naturally. Cybil Kincaid Profant
Thanks for sharing the info. I love sucking dick btw hmu Elisha Farr Crandell
Someone essentially assist to make critically posts I would state. That is the first time I frequented your web page and so far? I amazed with the research you made to make this actual submit amazing. Great activity! Christel Husein Nap
You have brought up a very good points , thankyou for the post. Flory Lewiss Land
The screw terminals as there is only 4 or 5 mm of depth for the mains wires to go. I tinned the wires but remain concerned that the wires are not firmly fixed. Any suggestions? Cordey Corrie Birkner
Post writing is also a excitement, if you be acquainted with after that you can write or else it is complicated to write. Kally Galvin Perretta
Love the flat! The views from it are breathtaking. We are jealous!! Morgana Friedrich John
You have noted very interesting details! ps decent site. Claretta Ulises Lamar
Awesome post. I am a regular visitor of your web site and appreciate you taking the time to maintain the nice site. I will be a frequent visitor for a long time. Christye D’Arcy Shakespeare
After I originally commented I seem to have clicked on the -Notify me when new comments are added- checkbox and now each time a comment is added I recieve four emails with the same comment. There has to be an easy method you are able to remove me from that service? Kudos! Coraline Humberto Dareen
You preserve a yard where lovable stray cats generally seem, begging for food and staying a while to play. Chris Aleksandr Janot
I and my buddies have already been studying the nice suggestions from your site and so at once I got a terrible feeling I never expressed respect to the web blog owner for those techniques. The people came so excited to see all of them and have now in fact been loving them. Thanks for actually being so considerate and then for making a choice on this sort of brilliant subject matter most people are really needing to be informed on. My honest apologies for not expressing appreciation to earlier. Paloma Dael Zacharias
Only wanna input that you have a very nice internet site , I enjoy the style it actually stands out. Aridatha Lefty Horter
Good post! We are linking to this great article on our site. Keep up the great writing. Jeannine Alexandro Dyke Mela Enoch McGee
Excelente video. Nunca dejas de sorprenderme y de excitarme Deanna Pattie Kallick
I got this web page from my pal who informed me about this site and now this time I am visiting this web page and reading very informative articles or reviews at this time. Lulita Jacky Lindahl
Dolor sit amet, consectetur adipiscing elit. Phasellus feugiat elit vitae enim lacinia semper. Cras nulla lectus, porttitor vitae urna iaculis, Melisandre tincidunt lectus. Brienne nec tellus sit amet massa auctor imperdiet imp vitae diam. Merline Orson Darach
I like to see that people are expanding their idea of what a basement should look like. Nice job Rob. Marlene Darby Benedikta
With every thing that seems to be developing throughout this specific area, all your viewpoints are generally fairly exciting. Having said that, I am sorry, but I can not give credence to your entire suggestion, all be it radical none the less. It looks to everybody that your opinions are actually not totally validated and in simple fact you are generally yourself not really thoroughly confident of your argument. In any event I did enjoy reading through it. Marylou Lorant Meng
You made some nice points there. I looked on the internet for the subject matter and found most individuals will agree with your site. Gena Kristos Sicular
Hey! This is my first visit to your blog! We are a collection of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done a extraordinary job! Halley Hermon Scully
Awsome site! I am loving it!! Will be back later to read some more. I am taking your feeds also. Kimmy Darnall Bergin
Hello there. I discovered your web site via Google while searching for a related matter, your site came up. It seems to be good. I have bookmarked it in my google bookmarks to visit later. Romonda Addy Herwick
I think it would be delicious with a cream cheese frosting. Meara Montague Croydon
Thanks for sharing such a nice opinion, piece of writing is nice, thats why i have read it entirely Fredelia Gram Undis
s ac feugiat gravida urna interdum cras per nulla urna mattis class dapibus turpis ultrices posuere scelerisque dictu Barrie Sauncho Jacinto
Awesome! Its in fact amazing piece of writing, I have got much clear idea regarding from this paragraph. Joli Derick Rissa
I will recommend your beautiful post site to my friends Janice Harris Querida
purchasing tadalafil online – tadalafil 10mg buy tadalafil generic online
tadalafil 10 mg – generic tadalafil canada tadalafil professional