Skip to content

Instantly share code, notes, and snippets.

View torleifhalseth's full-sized avatar

Torleif Halseth torleifhalseth

View GitHub Profile
@torleifhalseth
torleifhalseth / RelationLookupType.cs
Last active January 2, 2018 11:48
Umbraco Relations
namespace MyProject.Models
{
/// <summary>
/// Enum RelationLookupType
/// </summary>
public enum RelationLookupType
{
Child,
Parent
}
@torleifhalseth
torleifhalseth / Access-Control-Allow-Origin-ALL.xml
Last active November 11, 2015 11:27
Access-Control-Allow-Origin
<system.webServer>
<httpProtocol>
<customHeaders>
<!--
Allow Web API to be called from a different domain.
-->
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type, Accept" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>

Best / our practise on writing styled components

📖 Documentation

👮🏻 Conventions

Know your components. Look at existing components before you create a brand new one. It is really fun to create new components but please ask yourself or the designer if we already have a component that might do the job first! Maybe you can create a variant of an existing component or just use it out of the box? It is important to evaluate the complexity of creating a variant. Sometimes it is smarter to create a new component. Discuss with your teammates!

DRY - Don't repeat yourself - Use inheritance to share style between similar components.

@torleifhalseth
torleifhalseth / style.md
Last active March 4, 2022 07:12
Scalable and Modular Architecture for CSS

Best practise on writing scalable and modular css

👮🏻 Naming conventions

Selectors

  • Don't use ID's for style.
  • Avoid over-qualified selectors: h1.page-title, div > .page-title
  • Use meaningful names: $visual-grid-color not $color or $vslgrd-clr.