非常に Scss/Sassの新機能mod.scssファイルのどこかで、私が頻繁に再利用するUl > li
のスタイルをコーディングしました。しかし、別のmod.scssファイルでは、特定のインスタンスに対してこのコードを変更する必要があります。SCSS要素の特定のインスタンスを参照する
「UL/LIタグが.content-section
クラスの下で表示される場合、動作X、Y、Zを受け取ります」というif-like文を基本的に作成できますか?
.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>
また、あなたのHTML構造を共有することはできますか? – Roberrrt
絶対に、投稿を編集します –
「下位」は '.content-section 'の子孫を意味するのでしょうか、物理的にはページレイアウトの下にありますか? – amflare