Sehr Neu bei Scss/Sass Anderswo in meiner mod.scss-Datei, habe ich den Stil von Ul > li
codiert, den ich recht häufig wiederverwende. In einer anderen mod.scss-Datei muss dieser Code jedoch für eine bestimmte Instanz geändert werden.SCSS Verweis auf eine bestimmte Instanz eines Elements
Ist es möglich, im Wesentlichen eine if-like-Anweisung zu erstellen, die besagt: "Wenn ein UL/LI-Tag unter der .content-section
-Klasse auftritt, nehmen Sie die Verhaltensweisen X, Y und z an"?
.content-section
{
margin: 40px 0px;
& .siteTitleText
{
margin-bottom: 50px;
}
& .headers
{
margin-bottom: 30px;
}
img
{
margin: 30px 0px;
}
*ul*
}
HTML:
<div class="content-section vendors">
<p class="headers">Modules, partials, and vendor</p>
<p class="bodyText">As you can see this divides my project into three basic types of files. Modules, partials, and vendored stylesheets.</p>
<ul>
<li class="bodyText">The modules directory is reserved for Sass code that doesn't cause Sass to actually output CSS. Things like mixin declarations, functions, and variables.</li>
<li class="bodyText">The partials directory is where the meat of my CSS is constructed. A lot of folks like to break their stylesheets into header, content, sidebar, and footer components (and a few others). As I'm more of a SMACSS guy myself, I like to break things down into much finer categories (typography, buttons, textboxes, selectboxes, etc…).</li>
<li class="bodyText"></li>
</ul>
</div>
Können Sie auch Ihre HTML-Struktur teilen? – Roberrrt
Absolut, ich werde den Beitrag bearbeiten –
Bedeutet "unter" Abkömmling von '.content-Abschnitt 'oder physisch darunter auf dem Seitenlayout? – amflare