Ticket #1 (accepted enhancement)

Opened 6 months ago

Last modified 6 months ago

Separate default CSS styles from user-defined ones

Reported by: ben Owned by: sheep
Priority: Low Milestone:
Component: Hatta Wiki Version: 1.3.3dev
Keywords: Cc:

Description

Starting from 71980c205e62, Highlight rendering is broken.

Pygments already has few styles, I guess the probability that I want to pimp one of them is quite little, I don't understand this changeset, it's breaking my rendering.

Change History

comment:1 Changed 6 months ago by sheep

I assume you use a custom style. You will need to copy the pygments style from the default style page. Hatta no longer puts those styles inline in the HTML. This makes the pages smaller and lets you customize the colorizing easier. -- Radomir Dopieralski


What about having a ##pygment-style.css## that would be dynamically generated and (at will) partially redefined by ##style.css## ?

Same, why wouldn't a ##standard-style.css## be dynamically generated and ##style.css## from my repo used only for addition/customization to the standard style ?

We would then have a three layer CSS architecture:

  • user agent

standard-style.css (dynamical)
pygments-style.css (dynamical)
* style.css (only if in repository)

The generation cost is not that big, Browser are anyway caching those kind of stuff.

-- Ben


Ping ** Any though on that idea ?

Happy new year by the way //

-- Ben


I just pushed a  proof of concept. Please comment.

-- Ben


You can achieve pretty much the same result using the /+download/ urls and  @import CSS directive. You can actually divide your styles in as many pages as you want without having to modify a single line of Hatta's code.


By the way, rendering of style.css is currently broken. I'm not sure, I'm the one faulty there ... (see:   this line (1.16))

Just to be clear:

The trouble we are having is that for any one using a custom stylesheet, pygment rendering has been broken.

You suggested two solutions:

  • Duplicate the information from the pygment library into my own stylesheet
  • Use a @import directive to make it looks even more complicated.

Why I disagree with those solutions:

  • I don't want to specify the pyments style myself, at most, I want to specify a ##pygment_style## in my config file (like   this for instance), but deeper in pygments tweaking no-one wants to play with that.
  • You proposed the usage of @import: Add a @import to my style.css (which have to include the pygments rules) to overwrite some of my rules with others rules of mine. I really don't get the point there.

===What I proposed:===

Always serve a default style in every project, and just overwrite the one we want to overwrite in the ##style.css## file. This keeps full backward compatibility, doesn't not break any existing wiki using hatta, and allow users to have a more clean ##style.css## (don't need to redefine the stuff already defines somewhere else).

I guess we started from a misunderstanding, that's why I tried to make that answer as detailled as possible to start the discussion again from a stable base.

-- Ben


I'm sorry, I should have read your explanation more carefully. For now, I moved the pygments style to a separate page, and added the pygments_style config option -- it's a great idea, thanks. As for separating the Hatta's and user's CSS, I need to think about it some more, maybe do some tests... I understand that it's "the right way to do it", but it may be too difficult for users who are not familiar with how the css inheritance works. -- Radomir Dopieralski


No problem about that, I know communication is not my best quality ;). Thanks for implementing what you did. That way, we are back to a working situation. I hope your test will rise a similar or better solution to the one I proposed, I'm quite curious about it !

-- Ben


Did you made any progress on this side ?

--Ben

comment:2 Changed 6 months ago by sheep

  • Status changed from new to accepted
  • Type changed from defect to enhancement

comment:3 Changed 6 months ago by sheep

  • Priority set to Low

comment:4 Changed 6 months ago by sheep

  • Summary changed from Highlight broken to Separate default CSS styles from user-defined ones
Note: See TracTickets for help on using tickets.