Class Stylesheet
Represents a Stylesheet file
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class Stylesheet : File, IStylesheet, IFile, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceStylesheet(String)
Declaration
public Stylesheet(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path |
Stylesheet(String, Nullable<Func<File, String>>)
Declaration
public Stylesheet(string path, Func<File, string>? getFileContent)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
System.Nullable<Func<File, System.String>> | getFileContent |
Properties
View SourceContent
Gets or sets the Content of a File
Declaration
public override string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String |
HasIdentity
Indicates whether the current entity has an identity, which in this case is a path/name.
Declaration
public override bool HasIdentity { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Overrides the default Entity identity check.
Properties
Returns a list of umbraco back office enabled stylesheet properties
Declaration
[IgnoreDataMember]
public IEnumerable<IStylesheetProperty>? Properties { get; }
Property Value
Type | Description |
---|---|
System.Nullable<IEnumerable<IStylesheetProperty>> |
Remarks
An umbraco back office enabled stylesheet property has a special prefix, for example: /** umb_name: MyPropertyName */ p { font-size: 1em; }
Methods
View SourceAddProperty(IStylesheetProperty)
Adds an Umbraco stylesheet property for use in the back office
Declaration
public void AddProperty(IStylesheetProperty property)
Parameters
Type | Name | Description |
---|---|---|
IStylesheetProperty | property |
RemoveProperty(String)
Removes an Umbraco stylesheet property
Declaration
public void RemoveProperty(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |