Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CSS Paged Media Module page declaration #40

Merged
merged 1 commit into from Sep 19, 2012
Merged

Conversation

@kaleb
Copy link
Contributor

kaleb commented Sep 19, 2012

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

e.g.

div.landscape {
    page: my-landscape-page;
}
@kaleb

This comment has been minimized.

Copy link
Owner Author

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 added a commit that referenced this pull request Sep 19, 2012
Added CSS Paged Media Module page declaration
@jamietre jamietre merged commit ebd38ff into jamietre:master Sep 19, 2012
@jamietre
Copy link
Owner

jamietre commented Sep 19, 2012

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
Copy link
Contributor Author

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
Copy link
Owner

jamietre commented Sep 19, 2012

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

@kaleb
Copy link
Contributor Author

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
Copy link
Owner

jamietre commented Sep 19, 2012

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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.