Skip to content

Instantly share code, notes, and snippets.

@ncelico
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ncelico/4cb9914dedbeae46c844 to your computer and use it in GitHub Desktop.
Save ncelico/4cb9914dedbeae46c844 to your computer and use it in GitHub Desktop.
Styles Sitecore controls with Bootstrap inspired style (for Labels and Sitecore Text controls). The trick is in knowing that the span following the .scChromeData element is the content editable one used by Sitecore.
<div class="sitecore-form">
<div>
<label>Name</label>
</div>
<div>
<sc:Text runat="server" Field="Name" />
</div>
<div>
<label>Title</label>
</div>
<div>
<sc:Text runat="server" Field="Title" />
</div>
<div>
<label>Bio</label>
</div>
<div>
<sc:Text runat="server" Field="Bio" />
</div>
<div>
<label>Picture</label>
</div>
<div>
<sc:Image runat="server" Field="Picture" />
</div>
</div>
.sitecore-form label {
display: block;
margin: 10px 0;
font-weight: bold;
font-size: 18px;
text-decoration: underline;
}
.sitecore-form .scChromeData + span {
border: 1px solid #ccc;
-ms-border-radius: 4px;
border-radius: 4px;
color: #555;
font-size: 14px;
padding: 6px 12px;
margin-left: 15px;
width: 100%;
display: block;
-webkit-box-shadow: inset 0 1px 1px #000000;
-ms-box-shadow: inset 0 1px 1px #000000;
box-shadow: inset 0 1px 1px #000000;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-moz-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-ms-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment