| 
			
			 | 
		#1 | 
| 
			
			
			
			 Enthusiast 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33 
				Karma: 48958 
				Join Date: May 2017 
				
				
				
				Device: iPad Pro 9.7" 
				
				
				 | 
	
	
	
		
		
			
			 
				
				Turn off auto-formatting of CSS?
			 
			
			
			Is there a way to stop the calibre editor from messing with the CSS formatting? It's formatting choices are odd, not the ones I want, and too many things other than "Beautify" result in a autoreformat (e.g. "Organize into folders"?!?). 
		
	
		
		
		
		
		
		
		
		
		
		
	
	I have read and searched through the editor documentation, the editor Settings, and done some other web searches and not turned up anything. If there is not a way, please consider an Editor setting to leave CSS formatting alone. If there is a way, a pointer would be greatly appreciated. Thanks!  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688 
				Karma: 9500498 
				Join Date: Sep 2021 
				Location: Australia 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Are you referring to the code in the stylesheet.css? 
		
	
		
		
		
		
		
		
		
		
		
		
	
	What exactly is being changed? I've never noticed the editor change anything my my stylesheets.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#3 | 
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I was surprised about the word 'odd'. Except for the quirky coloring of the first 2 lines, it seemed to be pretty standard code styled.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688 
				Karma: 9500498 
				Join Date: Sep 2021 
				Location: Australia 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 ![]() Where do you see coloured lines and standard code styling? Last edited by Karellen; 03-06-2023 at 05:15 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | |
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,784 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | 
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				Join Date: Mar 2012 
				Location: Sydney Australia 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Perhaps the OP is referring to calibre changing the manner in which the content of CSS files is presented, not changing the actual text within them. e.g: changing: 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Code: 
	p {font-family: verdana; font-size: 20px;}
Code: 
	p {
  font-family: verdana;
  font-size: 20px;
}
 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | |
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,784 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 It's also possible that the OP has "Update metadata in the book when opening selected". That can be turned off via Edit > Preferences > Integration with calibre. Last edited by JSWolf; 03-06-2023 at 07:02 AM.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | |
| 
			
			
			
			 Well trained by Cats 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,267 
				Karma: 61916422 
				Join Date: Aug 2009 
				Location: The Central Coast of California 
				
				
				Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Code styling = indented  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Enthusiast 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33 
				Karma: 48958 
				Join Date: May 2017 
				
				
				
				Device: iPad Pro 9.7" 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			I said nothing about changing the CSS itself, I said the CSS formatting, i.e. the way it looks. I also said it had nothing to do with Beautify, and gave an example of a thing that reformats the CSS. "Beautify individual files on open" is not selected, and neither is "Update metadata in the book…"
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | |
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,688 
				Karma: 9500498 
				Join Date: Sep 2021 
				Location: Australia 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Is it too hard to provide a before/after example? Like I said, I have never seen anything change in my css files. I guess that is because I create them exactly as Calibre expects.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			No, there's no way to do that. Organize into folder causes file paths to change, changing file paths means url resources in CSS sheets potentially have to be re-written, which means they have to be parsed and serialized. And no, I dont have any interest in writing my own CSS parser/serializer that preserves original formatting.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,784 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Enthusiast 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33 
				Karma: 48958 
				Join Date: May 2017 
				
				
				
				Device: iPad Pro 9.7" 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Kovid, what third-party (I assume?) library/code/whatever are you using to parse/serialize the CSS?
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 creator of calibre 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,609 
				Karma: 28549044 
				Join Date: Oct 2006 
				Location: Mumbai, India 
				
				
				Device: Various 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#15 | 
| 
			
			
			
			 Enthusiast 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33 
				Karma: 48958 
				Join Date: May 2017 
				
				
				
				Device: iPad Pro 9.7" 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Thanks, I'll look into that more. 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Without knowing what else (other than beautify and folders) rewrites (and thus reformats) the CSS, is it possible/practical in the folders case to just have it not rewrite the file if there were no changes? IOW, A is original, B is parsed, C is after folder changes, if B=C, then don't overwrite A.  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
            
            
  | 
    
			 
			Similar Threads
		 | 
	||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Any way to turn off auto-hyphenation? | kytrid | Boyue | 9 | 09-21-2020 04:17 PM | 
| Stand and auto page turn | Lima7 | Kobo Reader | 2 | 09-07-2018 03:58 PM | 
| Auto turn pages | maac2212 | Kindle Developer's Corner | 3 | 05-19-2016 09:19 AM | 
| permanently turn off auto rotate | xxtraloud | Kindle Developer's Corner | 1 | 04-25-2014 02:03 AM | 
| iPod How to turn off auto rotate? | Ea | Apple Devices | 5 | 09-23-2010 04:56 AM |