Commit Graph

217 Commits

Author SHA1 Message Date
tophf
807ea6aa70 extract colorconverter.js 2018-01-07 11:52:43 +03:00
tophf
42bd77ec17 beautify: keep semicolon after /*comment*/ on the same line 2018-01-05 14:10:27 +03:00
tophf
b32832e237 delete the unused original beautify-css.js 2018-01-05 14:07:16 +03:00
tophf
2ca702c976 show color swatches on usercss installer page 2018-01-04 13:36:56 +03:00
tophf
743deb14c9 CSSLint: validations for animation, background, cursor and more
* CSS Animations Level 1 (ED 2017-11-29) https://drafts.csswg.org/css-animations/
* validation for background, border-image, cursor, text-shadow, background-position
2017-12-26 13:37:25 +03:00
tophf
b6f0b4a44f CSSLint: CSS Timing Functions Level 1 (WD & ED 2017)
WD 2017-02-21 https://www.w3.org/TR/css-timing-1/
ED 2017-12-03 https://drafts.csswg.org/css-timing/
2017-12-26 12:46:27 +03:00
tophf
6e0cb2bc86 CSSLint: validate using an unprefixed definition 2017-12-26 12:14:18 +03:00
tophf
1749f06674 CSSLint: CSS Transform Module Level 2 (ED 2017-11-09)
https://drafts.csswg.org/css-transforms-2/
2017-12-26 12:14:18 +03:00
tophf
c3cb687db6 CSSLint: CSS Transforms Module Level 1 (WD 2017-11-14)
https://drafts.csswg.org/css-transforms/
2017-12-26 11:51:48 +03:00
tophf
b8d1a0a9ff CSSLint: expose function's inner expression 2017-12-26 11:50:29 +03:00
tophf
afbee9d68f CSSLint: more microoptimizations 2017-12-26 06:28:27 +03:00
tophf
37f7f1898f fixup 1406cae6: ) may belong to the parent, also fix readString 2017-12-25 15:32:07 +03:00
tophf
d3c0999541 CSSLint: fixes and tweaks to reduce memory consumption
* _hexcolor - actually validate length
* all number regexps - support +- in the exponent
* readCount - single slice
* readMatch - use sticky regexps or string comparison on a chunk of pattern length
* readComment - single sticky match & slice
* readWhile - collect in an array, then join
* PropertyValuePart - do native num/str checks first
* isXXX - do a string comparison first
2017-12-25 12:25:19 +03:00
tophf
1406cae6c5 CSSLint: parse <declaration-value> for --custom-property
https://drafts.csswg.org/css-syntax-3/#typedef-declaration-value

Example:

:root {
  --fit: {
    position: absolute;
    top: 0; bottom: 0;
    left: 0; right: 0;
  }
}
2017-12-25 12:25:19 +03:00
tophf
4b4b65d961 colorview: support a signed number exponent 2017-12-25 02:21:25 +03:00
tophf
b70beac3c9 CSSLint: rewrite readNumber() 2017-12-25 02:20:53 +03:00
Rob Garrison
4b2bfd4113 CSSLint: Remove tabs causing properties to be ignored 2017-12-25 01:35:01 +03:00
Rob Garrison
b2ea9be73f CSSLint: Add text-decoration-skip 2017-12-25 01:35:01 +03:00
tophf
1040c20330 don't autohide colorpicker popup when invoked via hotkey 2017-12-24 14:33:58 +03:00
tophf
a53fb162a8 unbind 'display' listeners on first run 2017-12-24 14:28:25 +03:00
tophf
c958186245 FF workaround: set position:fixed prior to appending 2017-12-22 11:52:53 +03:00
tophf
d82efe37b5 rewrite colorpicker popup positioning to prevent occlusion 2017-12-22 11:22:35 +03:00
tophf
d0380f76c3 rewrite colorview to use CodeMirror::TextMarker
* solves all problems with glitching on selection etc.
* perceived performance is same due to lazy-processing
* colors unsupported in current browser are displayed internally as RGB
* the color text is highlighted in the editor when popup is invoked
2017-12-22 11:22:35 +03:00
tophf
e9a2cb92e3 csslint: functions MUST end with ) 2017-12-22 11:22:02 +03:00
tophf
c34786358a csslint: CSS4 syntax for rgb/hsl 2017-12-20 00:42:51 +03:00
tophf
8bfc36efbe csslint: warn about @media inside @supports 2017-12-18 12:18:54 +03:00
tophf
a7a589b785 csslint: CSS Grid Layout - actual implementation 2017-12-18 12:17:42 +03:00
tophf
4522362f76 csslint: CSS Grid Layout Module Level 1 (ED, Nov 28, 2017) 2017-12-18 10:27:58 +03:00
tophf
6607455e8f silence eslint; switch shirt-circuiting to single-line if/else 2017-12-18 10:27:50 +03:00
tophf
f29e3bc587 colorpicker: remove old theme class on re-invocation 2017-12-18 10:27:50 +03:00
tophf
fd047f8323 move getRealColors to colorpicker and reuse it 2017-12-18 10:27:50 +03:00
tophf
5aba0377a0 use helper's decisions in colorview renderer 2017-12-18 10:27:50 +03:00
tophf
6fb9d2d157 switch to a much faster LZStringUnsafe
https://github.com/pieroxy/lz-string/pull/98
2017-12-10 11:30:57 +03:00
tophf
240ccc8309 FF: actually prevent scrolling in focusNoScroll 2017-12-08 22:06:17 +03:00
tophf
1c68ac1a3a initialize editor page fully in First Meaningful Paint frame
* previously it wasn't the case when colorpicker option was enabled
* the cost of always loading colorview is ~1ms for >200ms here
2017-12-08 06:20:56 +03:00
tophf
f40dc29497 add rudimentary reject/catch for mozParser inside worker 2017-12-07 08:41:52 +03:00
tophf
08c70a5192 csslint: only suppress validation errors caused by USO-vars 2017-12-07 08:09:22 +03:00
tophf
aeca16f663 csslint: show real text of expected token if possible
now instead of the nerdy LBRACE users will see {
2017-12-07 05:37:36 +03:00
tophf
974b1f9152 csslint: don't throw on errors caused by USO vars 2017-12-06 06:34:02 +03:00
tophf
85c67872a5 make colorpicker notify embedder on closing
re-enables Esc key in config-dialog after colorpicker closed itself due to an outside click
2017-12-06 00:24:27 +03:00
eight
07a0518586 Add config dialog to popup (#283) 2017-12-06 00:14:21 +03:00
tophf
36ec8de04f stop calc when color is opaque 2017-12-05 21:01:32 +03:00
tophf
a6f63d096e extract checkboxes to global.css, fixes 2017-12-05 04:39:29 +03:00
tophf
48dda41e2e fixup 99512da9 and 493c1a65: show csslint rule info in issues info box 2017-12-04 08:57:12 +03:00
tophf
05d1013699 fixup 2e03c9c9: the element should be in DOM before reposition() 2017-12-02 17:18:58 +03:00
tophf
536064ae9a csslint fixup 88885403: 'simple' doesn't support conditional grammar 2017-12-02 05:13:55 +03:00
tophf
0eaee16f7e csslint: allow "transparent" in SVG colors 2017-12-01 23:04:38 +03:00
tophf
f3be825d25 csslint: expand referenced rules when describing errors 2017-12-01 22:55:39 +03:00
tophf
88885403ad csslint: CSS Box Alignment Module Level 3 (ED Nov 14)
https://drafts.csswg.org/css-align/
2017-12-01 05:52:23 +03:00
tophf
f5516db8f4 off-load mozParser to a worker 2017-12-01 02:35:56 +03:00
tophf
493c1a65c0 worker for stylelint; hints in linter config popup 2017-11-28 20:07:37 +03:00
tophf
99512da9da use CSSLint in a web werkker 2017-11-27 17:02:30 +03:00
tophf
fad03fb7c9 colorpicker: invoke callback on first color change 2017-11-27 14:54:19 +03:00
tophf
06a2a4c04d constrain manually typed values in colorpicker 2017-11-27 14:54:18 +03:00
tophf
2e03c9c9c0 same colorpicker in the manager 2017-11-27 14:54:18 +03:00
tophf
326dc5fb86 don't autofocus colorpicker input fields on small touch devices 2017-11-25 16:47:05 +03:00
tophf
2dda22f700 fix color swatch glitch on lint markers 2017-11-25 04:28:55 +03:00
tophf
15c5df0e6e colorpicker always picks up the only color in a line 2017-11-24 13:19:19 +03:00
tophf
7c0d8f0841 prevent inline overlays from breaking color swatches 2017-11-24 13:19:19 +03:00
tophf
7e4683d417 USO-vars in CSSLint 2017-11-24 13:19:19 +03:00
tophf
60247a6443 don't lowercase the original line! 2017-11-24 13:19:18 +03:00
tophf
7c746ab9a3 fix colorpicker keyboard increment with #HEX in CAPS 2017-11-24 13:19:18 +03:00
tophf
def05f2f0a csslint: add "isolation" 2017-11-24 13:19:17 +03:00
tophf
8cced2da35 csslint: add "mix-blend-mode" and the internal <blend-mode> 2017-11-24 13:19:16 +03:00
tophf
06cda0b2c1 fix colorpicker swatch glitches by monkeypatching match-highlighter 2017-11-24 13:19:14 +03:00
tophf
a30ef3ed14 restore the original match-highlighter and monkeypatch it 2017-11-24 13:19:14 +03:00
tophf
c1c61ed590 find more rgb/hsl colors near cursor in comments and strings 2017-11-24 13:19:14 +03:00
tophf
607160655d colorpicker shouldn't overwrite non-colors 2017-11-24 13:19:13 +03:00
tophf
0ed6e3d4bf don't reinsert reinterpreted color on start
do it only on the Enter key or once the user explicitly changed the color at least once
2017-11-24 13:19:10 +03:00
tophf
e0ea76a940 colorpicker hotkey: find color at cursor in strings/comments 2017-11-24 13:19:10 +03:00
tophf
5d00602ada switch colorpicker popup format on PgUp/PgDn only, not Tab 2017-11-24 13:19:09 +03:00
tophf
fc20479ab4 correctly unhook colorpicker in usercss#stylus mode 2017-11-24 13:19:08 +03:00
tophf
2c82cc3bbc fix glitching on highlighting of current token 2017-11-24 13:19:08 +03:00
tophf
75da5c50ce colorpicker Ctrl-up/down steps in 50 on S, L, .5 on alpha 2017-11-24 13:19:07 +03:00
tophf
2a0ecec28e show color swatches in usercss with stylus preprocessor 2017-11-24 13:19:07 +03:00
tophf
aa2fef7f72 more keyboard control in colorpicker popup
hex mode similar to chrome-devtools:
* Ctrl-Up/Down for R channel
* Shift-Up/Down for G channel
* Alt-Up/Down for B channel
* Up/Down treats the entire color as a hex integer e.g. #00f -> #010

rgb/hsl modes similar to chrome-devtools:
* Ctrl-Up/Down steps by 100 (alpha: by 1)
* Shift-Up/Down steps by 10 (alpha: by .1)
* Up/Down steps by 1  (alpha: by .01)

* PgUp/PgDn to switch format
* Tab to switch format when at the first/last input field
2017-11-24 13:19:06 +03:00
tophf
b99391887d add colorpicker hotkey config icon [default: none]
* uses the last submitted color by default
* doesn't insert the default color until a change or the Enter key
* fix a few bugs in colorpicker introduced in the rewrite
2017-11-24 13:19:06 +03:00
tophf
352846c8b4 fix and update ColorView.openPopup() 2017-11-24 13:19:06 +03:00
tophf
ce8a0a2d42 assign color swatches correctly: skip overlays in the middle 2017-11-24 13:19:05 +03:00
tophf
37a62b0407 fix/rewrite/integrate colorpicker
* full rewrite of colorview.js to make it 10-100 times faster (render on demand via extendMode)
* full rewrite of colorpicker.js to simplify CSS
* automatic light/dark theme based on current color of the editor
* fixes, tweaks, speedups
* color spot will always be on the left of its text i.e. no line break on wrapping
* support #RRGGBBAA and #RGBA hex colors
* support "transparent" as rgba(0, 0, 0, 0)
* HEX/hex toggle
* fix HSLA regexp
* Esc/Enter key to close
* innerHTML -> textContent
* toggle the feature correctly
* fade out before autohiding
* always show alpha 1 like devtools does
* set cursor:pointer only on the clickable part of the sliders
* bigger color format switcher with a tooltip
* autofocus input on open, disable spellcheck
* try not to obscure the source color spot & text
* restore focus without scrolling
2017-11-20 15:19:58 +03:00
tophf
c50b251ae4 add original colorpicker plugin 2017-11-19 15:55:35 +03:00
tophf
2a95793de0 csslint: fix PropertyValuePart.serializeString
Two old csslint bugs fixed:
* in the absence of capturing groups the replacer function receives the text and index
* the actual string "c" should be used to get character codes, not String class
2017-11-14 09:08:04 +03:00
tophf
5a4e1290d3 csslint: fire "enddocument" on }
fixes #235
2017-11-14 08:55:45 +03:00
tophf
d4ce2b2def csslint: add compat prefixes for flex*, remove ms-box-* 2017-10-19 19:25:05 +03:00
tophf
2421a7ae99 csslint: update user-select 2017-10-19 19:18:09 +03:00
tophf
213da44fcc csslint: add border-image-repeat: space 2017-10-19 19:18:05 +03:00
tophf
22284f34cb csslint: fix color values 2017-10-19 19:18:05 +03:00
Rob Garrison
f5342bd37e Lint: Add -webkit-sticky support to CSSLint 2017-10-11 01:01:24 +03:00
tophf
79c6f3e578 csslint: support var() in compound properties 2017-08-29 19:10:42 +03:00
tophf
9946f3c781 regroup some of lint* data and code
* all lint-related js files are prefixed by lint-
* config-related stuff is grouped in linterConfig
* CM helper is rewritten and moved in /edit now that CSSLint supports these features
* chromeSync methods that apply LZString got LZ in their names
* empty string is used for 'disabled' in linter selector
2017-08-28 15:20:37 +03:00
tophf
dfc3deaf01 csslint: support background-blend-mode 2017-08-28 15:20:37 +03:00
tophf
5c506f5cc9 csslint: support unicode-range 2017-08-28 12:53:10 +03:00
tophf
f80af3721c csslint: fix hsl/hsla regexp as per spec
* hue can be deg, %, rad, grad, turn - deg is default
* all numbers can be fractional
* hsla = hsl
2017-08-28 12:53:10 +03:00
Rob Garrison
6c3501bf9a Use rules or config consistently 2017-08-27 17:20:48 -05:00
Rob Garrison
21e22c2b6f Rename CSSLint ruleset to config 2017-08-27 17:20:48 -05:00
Rob Garrison
e96f0808ed Rename CSSLint rule config file & variable 2017-08-27 17:20:47 -05:00
Rob Garrison
988af5f1b8 Store linter rules with sync & LZ compression 2017-08-27 17:20:47 -05:00
Rob Garrison
cbe6decb03 Assign stylelint to global, not lint 2017-08-27 17:20:47 -05:00
Rob Garrison
9c4b7bc310 Update stylelint bundle readme 2017-08-27 17:20:47 -05:00
Rob Garrison
3085b71891 Update to optimized stylelint bundle 2017-08-27 17:20:46 -05:00
Rob Garrison
ac1ffa98b5 Add CSSLint rule configuration 2017-08-27 17:20:46 -05:00
Rob Garrison
8645469d3b csslint warning update 2017-08-27 17:20:46 -05:00
Rob Garrison
ce906eb4b6 Move csslint-worker file 2017-08-27 17:20:45 -05:00
Rob Garrison
1fc17861db Remove "Unexpected" from stylelint messages 2017-08-27 17:20:45 -05:00
Rob Garrison
d563495c26 Fix no-inline-comments issues 2017-08-27 17:20:45 -05:00
Rob Garrison
5ce7a925cb Move stylelint-config to edit folder 2017-08-27 17:20:45 -05:00
Rob Garrison
91825d11fd Clean up modified css-lint 2017-08-27 17:20:45 -05:00
Rob Garrison
29851a8de9 Dynamically load linter when selected 2017-08-27 17:20:44 -05:00
Rob Garrison
06130446c6 Set default stylelint severity warning 2017-08-27 17:20:43 -05:00
Rob Garrison
f52f8c57d8 Rename linter.js to css-lint.js 2017-08-27 17:20:43 -05:00
Rob Garrison
06cd78b643 Add stylelint settings popup & cleanup 2017-08-27 17:20:43 -05:00
Rob Garrison
07dce1006d Split out lint code from edit.js 2017-08-27 17:20:43 -05:00
Rob Garrison
dfa71f699e Add linter select option 2017-08-27 17:20:42 -05:00
Rob Garrison
139d7ebb98 Show stylelint warnings & use minified bundle 2017-08-27 17:20:42 -05:00
Rob Garrison
a44b4e7822 Switch from CSSLint to stylelint 2017-08-27 17:20:42 -05:00
Rob Garrison
1a630033bd Use a single declaration per line 2017-07-14 04:10:00 -05:00
Rob Garrison
7a9d629ec8 Restructure folders 2017-07-12 16:26:20 -05:00