Added CSS Paged Media Module page declaration #40

Merged
merged 1 commit into from Sep 19, 2012

Projects

None yet

2 participants

@kaleb
Contributor
kaleb commented Sep 19, 2012

See: http://www.w3.org/TR/css3-page/#page

e.g.

div.landscape {
    page: my-landscape-page;
}
@kaleb
Owner
kaleb commented on da2abe4 Sep 19, 2012

I was forced to write:

Html[selector].Each((i, el) => el.Style.SetRaw("page", pageName));

When I really just wanted to write:

Html[selector].Css("page", pageName);

This even curiously threw an error:

Html[selector].Each((i, el) => el.Style.SetStyle("page", pageName, false));
@jamietre jamietre merged commit ebd38ff into jamietre:master Sep 19, 2012
@jamietre
Owner

The last method should have worked - I will take a look at that. Just glanced at the code and didn't see anything obvious but will create some tests and see what's up.

I keep meaning to add a global option to disable style syntax checking too, since styles evolve pretty fast and this might not be wanted by everyone, this might be the time.

@kaleb
Contributor
kaleb commented Sep 19, 2012

I cannot seem to reproduce the last one. :-/ I was looking at the code and could not figure why it was not working. Apparently it was user error. Thanks for taking my commit!

@jamietre
Owner

Alls well that ends well. I will still be adding that option, syntax checking should not be mandatory!

@kaleb
Contributor
kaleb commented Sep 19, 2012

Is there an ad hoc way of adding arbitrary class rules? So one can have validation, but one can add one's own.

@jamietre
Owner

The style definitions are loaded into a dictionary of HtmlParser.HtmlStyles.StyleDefs so you could certainly add your own, all the objects are public. The style data is parsed into CsQuery.Implementation.CssStyle objects which are stored in the dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment