Skip to content

User Content CSS Adjustment for tables #221

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

Closed
Martii opened this issue Jun 27, 2014 · 4 comments
Closed

User Content CSS Adjustment for tables #221

Martii opened this issue Jun 27, 2014 · 4 comments
Labels
enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. mightfix Ehh maybe... convince us all... question A question has been encountered by anyone and has remained unanswered until cleared.

Comments

@Martii
Copy link
Member

Martii commented Jun 27, 2014

Does anyone see an issue with adding the following CSS rule to common.css?

.user-content th > a {
  display: inline;
}

Currently in the Compatibility Matrix of this script anchored th tags are block level due to a general rule of:

th > a {
  color: initial;
  display: block;
}

... and messes up multiple anchored images inside the tag. This changed when the UI was updated. Since we support markup now it's easy to do a <br /> if we want one in a user defined th tag.


EDIT: Another personal preference option is to add some faint lines and an offset background color for th tags like the right side panel defaults. Is this preferred?

Btw @sizzlemctwizzle center, left and right are being sanitized from #190 and 23f47bc when used with gfm table support alignment and the classes may not be defined too. I haven't had a chance to find a way to filter through just those three yet but only in .user-content with th tags and exclude anything else... unless we need something else down the line.

@Martii Martii changed the title User Content CSS Adjustment for tables User Content CSS Adjustment for table header Jun 27, 2014
@Martii Martii changed the title User Content CSS Adjustment for table header User Content CSS Adjustment for tables Jun 27, 2014
@Martii Martii added the bug label Jun 27, 2014
Zren added a commit to Zren/OpenUserJS.org that referenced this issue Jun 27, 2014
Linkify the announcements header, and remove the "older" link.
Refine "th > a { display:block; }" rule to only work inside a .table as it breaks tables in .user-content
@Zren
Copy link
Contributor

Zren commented Jun 27, 2014

Going to prefix .table onto the rule

.table th > a {
  color: initial;
  display: block;
}

as it's better to use a more refined rule than overriding specific cases. Also, Markdown doesn't add the bootstrap .table class.


Edit: Though if we did add .table to the generated markdown...

Bleh. We probably need to go over all the md tags for css.

@Martii
Copy link
Member Author

Martii commented Jun 27, 2014

@Zren
So are you -1 for making .user-content tables more visible/styled or is that part of #223 ?

Also if we allow th.class in the sanitize-html for user-content made gfm tables that would allow anyone to use any of our classes I think... that might bust the layout if used maliciously... I'm still hunting for a good post process class sanitizer... e.g. two pass filtering.

@Martii Martii added the later label Jul 16, 2014
Martii pushed a commit to Martii/OpenUserJS.org that referenced this issue Oct 19, 2014
…*bootstrap* `class` for tables

* Allows alignment of tables to be specified with GFM.
* Briefly mentioned at OpenUserJS#221 (comment)
Martii pushed a commit to Martii/OpenUserJS.org that referenced this issue Oct 19, 2014
* Apply these specific rules to all affected areas
* Move script page rule out to `common.css`

**NOTE**: Still affected is OpenUserJS#221 since available rules aren't consistent however OpenUserJS#363 may be acceptable work-around
@Martii Martii mentioned this issue Oct 19, 2014
@Martii
Copy link
Member Author

Martii commented Oct 20, 2014

@Zren
I tried your rule set and it has the same issue if I use inline.... At approximately 1268px and 1260px wide on the viewport it resplits/unsplits. Since I finally got gfm table alignment figured out in #363 it might be okay to keep it split visually all the time... when the latest commits get deployed to pro it should help me decide if this issue can be closed or not after I update a few pages.

Though if we did add .table to the generated markdown...
...
Bleh. We probably need to go over all the md tags for css.

The sanitizer now supports transformations on tags with classes as I used in #363... so that can always be a possibility however the table doesn't look pretty imo with that class... but there is always tomorrow. :)

@Martii Martii added mightfix Ehh maybe... convince us all... and removed bug You've guessed it... this means a bug is reported. labels Oct 23, 2014
@Martii
Copy link
Member Author

Martii commented Oct 23, 2014

I think I'm going to revoke my request on this with a mightfix and close... with centering things look much nicer and I can revert back to my original icons as I did in https://openuserjs.org/scripts/Marti/oujs_-_Meta_View#-compatibility-matrix

It would be useful to create a class that doesn't expand to the container and we can whitelist that but probably needs some more pondering time.

If anyone really needs this feature enhancement reopened please do with a comment as to why.

@Martii Martii closed this as completed Oct 23, 2014
@Martii Martii removed the later A long time ahead, in a galaxy near, near... label Feb 9, 2015
@OpenUserJS OpenUserJS locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Something we do have implemented already but needs improvement upon to the best of knowledge. mightfix Ehh maybe... convince us all... question A question has been encountered by anyone and has remained unanswered until cleared.
Development

No branches or pull requests

2 participants