350d / stylish

Stylish for Safari
http://sobolev.us/stylish
180 stars 135 forks source link

Maximum style length? #25

Closed silverwind closed 7 years ago

silverwind commented 7 years ago

Is it possible that there is a limit on how big a user stylesheet can be in bytes/lines? I'm observing that certain rules from http://userstyles.org/styles/37035 are not being applied with this extension, for example this rule (currently on line 1440 of the style):

.site-header-nav a { color: #e2e2e2 !important; }

When I manually move the rule to the beginning of the style, it is applied correctly. Same rules work in Stylish for Chrome and Firefox (These are the topic tags on Github repos like https://github.com/StylishThemes/GitHub-Dark).

I thought that another explanation could be that something might throwing off Safari's CSS parser,but I'm not seeing anything logged in the browser console at least.

350d commented 7 years ago

@silverwind did you tried to disable css minification in Stylish settings already?

silverwind commented 7 years ago

Yes, it's disabled and I reinstalled the style multiple times with that setting.

350d commented 7 years ago

As i can see - complete style injected without any problems and complete style availabe to edit and update, so, should be a problem in style itself.

silverwind commented 7 years ago

Do you know if there is there a debug console in Safari that points out CSS errors in user styles?

350d commented 7 years ago

I've added last line with debug rule * {color: red !important} and everything works fine:

screenshot 2017-02-16 14 48 25

350d commented 7 years ago

.site-header-nav a available two times in this style and if you trying to move last one to beginning of the style, you still have another rule in other place

silverwind commented 7 years ago

Sorry, meant to post this better example:

.topic-tag { background: #182030 !important; }
silverwind commented 7 years ago

Still trying to find the cause, but I guess it's not an issue with the extension. Maybe a unquoted data-uri or something similar is throwing off Safari's parser.

350d commented 7 years ago

Try latest version 1.9.8 and report back please.

silverwind commented 7 years ago

It works! I had to reinstall the style two times, but now everything is fine.

350d commented 7 years ago

cool, i guess problem was in minification and way to check this option status, so, enjoy 😀 I will resubmit this version ASAP to Apple

silverwind commented 7 years ago

Nice. The issue was looking like a section in the middle of the style was "invisible" to Safari, really weird.

Which minfier (and options) are you using? I can recommend https://github.com/jakubpawlowicz/clean-css btw :)

350d commented 7 years ago

YUI Compressor